ZitatAlles anzeigen
SAMP 0.3c RC
We are releasing a scripting (player limited) version of SA-MP 0.3c early, so that server owners and scripters can start updating their scripts and making any changes needed for the next SA-MP version. A full release of 0.3c is not expected for at least a few more weeks.
SA-MP 0.3c is mainly a feature update. Bugs will be fixed throughout the RC, so they can be reported. Higher priority will be given to bugs in any of the new features.
SA-MP 0.3c RC1 release information is below
Important changes needed to make 0.3b scripts work with 0.3c
The functions SetPlayerHoldingObject, IsPlayerHoldingObject and StopPlayerHoldingObject have been removed. These functions were limited in the fact that they could only attach 1 object to each player. New functions have been added which allow you to attach up to 5 objects to each player.
#define MAX_PLAYER_ATTACHED_OBJECTS 5 // This is the number of attached indexes available ie 5 = 0-4
native SetPlayerAttachedObject(playerid, index, modelid, bone, Float:fOffsetX = 0.0, Float:fOffsetY = 0.0, Float:fOffsetZ = 0.0, Float:fRotX = 0.0, Float:fRotY = 0.0, Float:fRotZ = 0.0, Float:fScaleX = 1.0, Float:fScaleY = 1.0, Float:fScaleZ = 1.0);
native RemovePlayerAttachedObject(playerid, index);
native IsPlayerAttachedObjectSlotUsed(playerid, index);
If you have a lot of script bound to SetPlayerHoldingObject, these defines below might be useful. You can add them to the top of your pwn file after a_samp.inc is included. These will use player attached object slot number 4.
#define SetPlayerHoldingObject(%1,%2,%3,%4,%5,%6,%7,%8,%9) SetPlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1,%2,%3,%4,%5,%6,%7,%8,%9)
#define StopPlayerHoldingObject(%1) RemovePlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
#define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1,MAX_PLAYER_ATTACHED_OBJECTS-1);
Colour embedding:
You can use {RRGGBB} (hex) strings embedded in text to change the text colour. This works in the chat window, in dialogs, and in numberplates. Colour codes are automatically replaced with () in player chat text. The only exception to the colour code filtering is input dialog response text.
The return of SetVehicleNumberplate()
While the function name is the same, it works differently. All cars now have a generic numberplate "XYZR 000". The numberplate will only change if SetVehicleNumberPlate() is used. The string limit for a numberplate is 32 characters, which gives you enough space for an 8 character numberplate plus some additional room for colour codes. Please use this function with care and don't go assigning custom numberplates to vehicles that don't have plates (like planes/boats etc), as this would result in unneeded processing time on the client.
SetVehicleParamsEx()
New extended parameters for vehicles that allow you to change the state of the
vehicle engine, lights, alarm, doors locked, bonnet open/closed, boot open/closed, objective status.
These don't have to be set for each player anymore like SetVehicleParamsForPlayer(). They're
automatically replicated to all players.
#define VEHICLE_PARAMS_UNSET -1
#define VEHICLE_PARAMS_OFF 0
#define VEHICLE_PARAMS_ON 1
native SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
native GetVehicleParamsEx(vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective);
Example:
new engine,lights,alarm,doors,bonnet,boot,objective;
if(strcmp(cmd, "/startengine",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
}
return 1;
}
if(strcmp(cmd, "/stopengine",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
}
return 1;
}
You can also write wrapper functions around this function e.g.
SetVehicleEngineOn(vehicleid)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
}
ManualVehicleEngineAndLights()
ManualVehicleEngineAndLights() can be used in OnGameModeInit(), or somewhere before players connect. It will instruct all clients that the server controls both the vehicle engines and the lights. That means the engine will not automatically start when the player enters the vehicle and the lights will not automatically come on at night. This is useful for role playing servers where the player might manually have to start/stop the engine. The behaviour of SetVehicleParamEx with manual engine/lights control is different depending on whether manual (server) engine and lights control is enabled.
AttachObjectToVehicle
Hopefully this one is self-explanatory.
New objects, particle objects, samp.img, samp.ide
There are a lot of things that need to be documented regarding this. Some useful information should appear on the SA-MP wiki within the next few weeks. To give a brief overview, thanks to the SA-MP beta team, SA-MP now includes hundreds of new objects, including particle objects. These objects use model/object IDs that are not normally available in San Andreas. A full list of IDs can be found in your GTA SA folder under models\samp.ide after you install any version of SA-MP 0.3c.
0.3c R1 files
0.3c-RC1 Client Installer
0.3c-RC1 linux Server (20 player)
0.3c-RC1 Windows Server/Scripting (20 player)
Originallink: http://forum.sa-mp.com/showthread.php?t=194031
EDIT: Moved by Grex