14.08.2011, 09:49
I've created this command :
Well, but ingame, how can I make that what I excatly write in the [platenumber] will be excatly on the plate ?
e.g : I write /changeplate 1337 then the car plate's will be 1337.
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);
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;
}
e.g : I write /changeplate 1337 then the car plate's will be 1337.