05.01.2011, 23:57
Use:
pawn Код:
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/caroptions", true))
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF0000FF,"You must be in a vehicle.");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Car Options", "License Plate", "Select", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
if(listitem == 0) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Linence Plate", "Enter your license nuber (MAX: 32 characters)", "Update", "Cancel");
}
}
else if(dialogid == 2)
{
if(response)
{
for(new v = 0; v < MAX_PLAYERS; v ++)
{
New Float:X, Float:y, Float:z, Floatt:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
SetVehicleNumberPlate(v,inputtext);
SetVehicleToRespawn(v);
SetVehiclePos(v, X, Y, Z);
SetVehicleZAngle(v, A);
PutPlayerInVehicle(playerid, v, 0)
}
return 1;
}
}
return 0;
}