Guest User

Untitled

a guest
Mar 23rd, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.39 KB | None | 0 0
  1. CMD:car(playerid, params[])
  2. {
  3.     if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_ORANGE, "You already have a car");
  4.  
  5.     new modelid, color1, color2;
  6.     if(sscanf(params, "iiI(-1)")) return SendClientMessage(playerid, COLOR_ORANGE, "System: /car [id] [color1] [color2]");
  7.  
  8.     if(color2 == -1) color2 = color1;
  9.  
  10.     if(modelid > 611 || modelid < 400) return SendClientMessage(playerid, COLOR_ORANGE, "Wrong car id");
  11.  
  12.     if(CreateCar[playerid] != 0) DestroyVehicle(CreateCar[playerid]);
  13.  
  14.     new Float:pos[4];
  15.     GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  16.     GetPlayerFacingAngle(playerid, pos[3]);
  17.  
  18.     CreateCar[playerid] = CreateVehicle(modelid, pos[0], pos[1], pos[2], pos[3], color1, color2, 50000); // 50,000 seconds? It might as well be -1... Do you mean 50 seconds?
  19.     //SetVehicleNumberPlate(CreateCar[playerid], tmp4); // There's no parameter for this...
  20.     //SetVehicleToRespawn(CreateCar[playerid]); // Why would you want to respawn it..?
  21.     PutPlayerInVehicle(playerid, CreateCar[playerid], 0);
  22.     SetVehicleVirtualWorld(CreateCar[playerid], GetPlayerVirtualWorld(playerid));
  23.  
  24.     foreach(new i : Player)
  25.     {
  26.         if(i == playerid) continue;
  27.  
  28.         SetVehicleParamsForPlayer(CreateCar[playerid], i, 0, true);
  29.     }
  30.  
  31.     //new
  32.     //string[144];
  33.     //format(string, sizeof string, " %s SPAWNED SUCCESFUL", VehicleNames[modelid-400]);
  34.     //SendClientMessage(playerid, COLOR_BLUE, string);
  35.  
  36.     return 1;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment