28.12.2010, 13:51
The command should work. What do you want to do? Save it to a file so it will automaticly respawn with that plate number?
pawn Код:
// plate
if(strcmp(cmd, "/plate", true) == 0)
{
if(!IsPlayerConnected(playerid)){return 0;}
if(PlayerInfo[playerid][pAdmin] < 1){return 0;}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /plate [number/name]");
return 1;
}
else if(strlen(tmp) > 32)
{
SendClientMessage(playerid, COLOR_GRAD1, "ERROR: Plate text can't be longer then 32 characters (including colors).");
return 1;
}
else
{
new Float:vx, Float:vy, Float:vz;
new tempveh = GetPlayerVehicleID(playerid);
GetVehiclePos(tempveh, vx, vy, vz);
SetVehicleNumberPlate(tempveh, tmp);
SetVehicleToRespawn(tempveh);
SetVehiclePos(tempveh, vx, vy, vz);
PutPlayerInVehicle(playerid, tempveh, 0);
}
return 1;
}