Niko_Hs

[COMMAND]SpawnVehicleNames

Sep 13th, 2011
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.19 KB | None | 0 0
  1.  if(strcmp(cmd,"/spawncar", true)== 0)
  2.         {
  3.         new Float:vx, Float:vy, Float:vz, vid;
  4.         tmp = strtok(cmdtext, idx);
  5.         if (!strlen(tmp)) return SendClientMessage(playerid, 0x00D90044, "Usa: /spawncar [vehicleid/nome]");
  6.         if (IsNumeric(tmp) == 1)
  7.         {
  8.     vid = strval(tmp);
  9.     }else{
  10.     vid = GetVehicleIDFromName(tmp);
  11.         }
  12.         if ((vid < 400) || (vid > 611) || (vid == 590) || (vid == 569) || (vid == 570) || (vid == 537) || (vid == 538) || (vid == 449))
  13.         {
  14.     return SendClientMessage(playerid, 0x00D90044, "Veicolo non riconosciuto.");
  15.         }
  16.         else
  17.         {
  18.     GetPlayerPos(playerid, vx, vy, vz);
  19.     CreateVehicle(vid, vx + random(9) - 4, vy + random(9) - 4, vz, 0, -1, -1, -1);
  20.     new car = GetPlayerVehicleID(playerid);
  21.     format(stringa,sizeof(stringa),"{FF0A00}T{FFFFFF}F{00FF1E}S{FFFFFF} %d",random(999));
  22.     SetVehicleNumberPlate(car, stringa);
  23.     GetVehicleModel(vid);
  24.     GetPlayerName(playerid, nome, sizeof(nome));
  25.     format(stringa, sizeof(stringa), "{00FF00}%s {FFFFFF}ha spawnato un {FF0000}%s", nome, VehicleName[vid - 400]);
  26.     SendClientMessageToAll(-1, stringa);
  27.     return 1;
  28.         }
  29.         }
Advertisement
Add Comment
Please, Sign In to add comment