citromhun

Numplate

Mar 31st, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.02 KB | None | 0 0
  1. #include "a_samp"
  2. #include "zcmd"
  3.  
  4. CMD:rendszam(playerid, params[]) {
  5.     if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000AA, "A driver needs the command for his usage to be!");
  6.     if(isnull(params)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /numplate [new numplate]");
  7.     if(!(2 < strlen(params) < 19)) return SendClientMessage(playerid, 0xFF0000AA, "Character one needs at least 3, at most 18 for the registration number to be.");
  8.     new vehicleid = GetPlayerVehicleID(playerid);
  9.  
  10.     new Float:p[4];
  11.     GetVehiclePos(vehicleid, p[0], p[1], p[2]);
  12.     GetVehicleZAngle(vehicleid, p[3]);
  13.  
  14.     SetVehicleNumberPlate(vehicleid, params);
  15.     SetVehicleToRespawn(vehicleid);
  16.  
  17.     SetVehiclePos(vehicleid, p[0], p[1], p[2]);
  18.     SetVehicleZAngle(vehicleid, p[3]);
  19.  
  20.     PutPlayerInVehicle(playerid, vehicleid, 0);
  21.  
  22.     new string[144];
  23.     format(string, 144, "You rewrote the registration number of your vehicle successfully: '%s'", params);
  24.     SendClientMessage(playerid, 0x33AA33FF, string);
  25.     return 1;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment