12.03.2012, 17:37
Add this under OnPlayerCommandText(playerid, cmdtext[])
This under public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
pawn Код:
if (strcmp("/setlicenseplate", cmdtext, true, 10) == 0) {
new Float:x,Float:y,Float:z,Float:ang;
GetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
GetVehicleZAngle(GetPlayerVehicleID(playerid),ang);
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,"You're not in a vehicle!");
ShowPlayerDialog(playerid,0,DIALOG_STYLE_INPUT,"{EE7777}Vehicle Numberplate","{00CC66}Input your new vehicle numberplate below.","Yes","Cancel");
return 1; }
pawn Код:
if(dialogid == 0) {
if(response) {
new Float:x,Float:y,Float:z,Float:ang;
SetVehicleNumberPlate(GetPlayerVehicleID(playerid), inputtext);
GetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
GetVehicleZAngle(GetPlayerVehicleID(playerid),ang);
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
PutPlayerInVehicle(playerid,GetPlayerVehicleID(playerid),0);
SetVehicleZAngle(GetPlayerVehicleID(playerid),ang);
} else {
SendClientMessage(playerid,0xFFFFFFFF,"You cancelled!"); } }
return 1; }