30.01.2014, 00:24
pawn Код:
#define DIALOG_PLATE = 999
CMD:changeplate(playerid)
{
if(Player_Data[playerid][Donator] > 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
{
ShowPlayerDialog(playerid, DIALOG_PLATE, DIALOG_STYLE_INPUT, ":: Vehicle Change plate for Donators ::", "{ffffff}Please insert your selected plate for\n[ff0000}Vehicle", "Change", "Exit"");
}
else return SCM(playerid, RED, "You need to be in a vehicle to change it's numberplate.");
}
else return SCM(playerid, RED, "You need to have atleast Donator level 1 for this command.");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_PLATE) //Dialog Register
{
if(response)
{
new vid = GetPlayerVehicleID(playerid);
new plate[24] = inputtext;
if(strlen(plate) <= 8 || strlen(plate) >= 1)
{
SetVehicleNumberPlate(vid, plate);
SCM(playerid, RED, "Your vehicle plate has been changed.");
}
else return SCM(playerid, RED, "Vehicle plate boundries abused. Please try an nother input.");
}
if(!response)return SCM(playerid, RED, "Canceled.");
}
return 1;
}