Advertisement
DraKiNs

[COD] Trocar Placa Veiculo

Jun 30th, 2011
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.31 KB | None | 0 0
  1. public OnPlayerCommandText( playerid, cmdtext[])
  2. {
  3.     if (!strcmp( cmdtext, "/mudarplaca", true))
  4.     {
  5.         return ShowPlayerDialog(playerid, 1010, DIALOG_STYLE_INPUT, "Sistema de Placa", " Digite sua Placa: \n\n Maximo de 8 Caracteres", "Mudar", "Cancelar");
  6.     }
  7.     return 1;
  8. }
  9.  
  10.  
  11. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  12. {
  13.     if(dialogid == 1010)
  14.     {
  15.  
  16.         if(!inputtext[0] || strlen(inputtext) > 8)
  17.             return SendClientMessage(playerid, 0xAFAFAFAA, "Texto Invalido.");
  18.  
  19.         #if !defined MAX_STRING
  20.             #define MAX_STRING 128
  21.         #endif
  22.  
  23.         static
  24.             string[MAX_STRING]
  25.         ;
  26.  
  27.         format(string, MAX_STRING, "Você mudou o texto de sua placa para %s.", inputtext);
  28.         SendClientMessage(playerid, 0x33CCFFAA, string);
  29.  
  30.         PutPlayerInVehicle(playerid, SetVehiclePlateEx(GetPlayerVehicleID(playerid), inputtext), 0); //colocar player dentro do veiculo de volta
  31.     }
  32.     return true;
  33. }
  34.  
  35.  
  36. SetVehiclePlateEx(vehicleid, strplate) //funcao para trocar de placa
  37. {
  38.     static
  39.         Float:xPos,
  40.         Float:yPos,
  41.         Float:zPos,
  42.         Float:aPos
  43.     ;
  44.  
  45.     SetVehicleNumberPlate(vehicleid, strplate);
  46.     GetVehiclePos(vehicleid, xPos, yPos, zPos);
  47.     GetVehicleZAngle(vehicleid, aPos);
  48.  
  49.     SetVehicleToRespawn(vehicleid);
  50.     SetVehiclePos(vehicleid, xPos, yPos, zPos);
  51.     return SetVehicleZAngle(vehicleid, aPos), vehicleid;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement