How To Add Cmds like /changeplate /rainbow /wheels(change Wheels) and more for cars
Код:
if (strcmp(cmd, "/changeplate", true, 12)==0)
{
cmd = strtok(cmdtext, idx);
if(!strlen(cmd))
{
SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /platechange [platenumber (up to 8 chars, use '-' for space char)]");
return 1;
}
if(IsPlayerInAnyVehicle(playerid) == 1)
{
SetVehicleNumberPlate(GetPlayerVehicleID(playerid), cmd);
new vehid=GetPlayerVehicleID(playerid);
SetVehicleToRespawn(vehid);
SendClientMessage(playerid, 0xFF9900AA, "License plate changed!");
new Float:x;
new Float:y;
new Float:z;
GetPlayerPos(playerid, x, y, z);
//Wait(500); //added this line so the car will change POS after spawning.
SetVehiclePos(vehid, x, y, z+2);
//GameTextForPlayer(playerid, cmd, 2500, 3);
return 1;
}
else
{
SendClientMessage(playerid, 0xFF9900AA, "You are not in a vehicle.");
}
return 1;
}