07.10.2011, 06:34
Hello,
I am looking for some one to help me with that plate system. I need when I use "/plate" my vehicle plate save in scriptfiles/notepad file.
with dini.
Here is the whole script of my /plate system.
I am looking for some one to help me with that plate system. I need when I use "/plate" my vehicle plate save in scriptfiles/notepad file.
with dini.
Here is the whole script of my /plate system.
pawn Код:
if(strcmp(cmd, "/plate",true)== 0)
{
new ID = GetPlayerVehicleID(playerid);
new strings[256];
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0x00FFFFFF, "You're not in a vehicle");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /plate <License Plate>");
else
{
format(strings, sizeof(strings), "%s",tmp);
SetVehicleNumberPlate(ID,strings);
strmid(CarInfo[VehicleOwned[ID]][cLicense], strings, 0, strlen(strings), 255);
SetVehicleToRespawn(ID);
format(strings,sizeof(strings),"{00C0FF}You've changed your plate name to %s please spawn your vehicle again",tmp);
SendClientMessage(playerid, COLOR_LIGHTRED, strings);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SaveCars();
}
return 1;
}
pawn Код:
public OnVehicleSpawn(vehicleid)
{
VehicleEngine[vehicleid] = 0;
VehicleWindows[vehicleid] = 0;
CarRadio[vehicleid] = 0;
SetVehicleNumberPlate(vehicleid,CarInfo[VehicleOwned[vehicleid]][cLicense]);
if(VehicleOwned[vehicleid] != SCRIPT_CARS)
{
if(VehSpawned[vehicleid] == 0)
{
VehicleOwned[vehicleid] = SCRIPT_CARS;
DestroyVehicle(vehicleid);
VehSpawned[vehicleid] = 0;
}
else
{
VehSpawned[vehicleid] = 0;
}
}
return 1;
}