pawn Код:
CMD:changeplate(playerid, params[])
{
new platenumber[124];
if(sscanf(params, "i[24]", platenumber)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /changeplate [platenumber]");
if(!IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid, 0xFF9900AA, "You are not in a vehicle.");
if(!dini_Exists("CarPlates.ini")) {
dini_Create("CarPlates.ini");
}
new Str[128];
new vehid = GetPlayerVehicleID(playerid);
format(Str,128,"%d",vehid);
dini_Set("CarPlates.ini", Str, platenumber);
platenumber = strval(params);
SetVehicleNumberPlate(GetPlayerVehicleID(playerid),platenumber);
SetVehicleToRespawn(vehid);
SendClientMessage(playerid, 0xFF9900AA, "License plate changed!");
new Float:x, Float:y, Float:z, Float:a;
GetVehicleZAngle(vehid,a);
GetPlayerPos(playerid,x,y,z);
SetVehiclePos(vehid,x,y,z);
SetVehicleZAngle(vehid,a);
PutPlayerInVehicle(playerid, vehid, 0);
return 1;
}