10.03.2011, 21:44
pawn Код:
#include <a_samp>
public OnPlayerCommandText( playerid, cmdtext[])
{
if ( strcmp( cmdtext, "/mudarplaca", true) == 0)
{
ShowPlayerDialog(playerid, 10101, DIALOG_STYLE_INPUT, "Sistema de Placa", "Digite sua Placa:\n\nMaximo de 8 Caracteres", "Mudar", "Cancelar");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 10101)
{
if(!response)
{
new string[128], Float:X, Float:Y, Float:Z, Float:angle;
if(strlen(inputtext) < 1 || strlen(inputtext) > 8) return SendClientMessage(playerid, 0xAFAFAFAA, "Texto Invalido.");
format(string, sizeof(string), "Vocк mudou o texto de sua placa para '%s'.", inputtext);
SendClientMessage(playerid, 0x33CCFFAA, string);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, angle);
SetVehicleNumberPlate(GetPlayerVehicleID(playerid), inputtext);
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
GetPlayerPos(playerid, X, Y, Z);
SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
SetVehicleZAngle(GetPlayerVehicleID(playerid), angle);
PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z+2);
}
}
return 1;
}