Guest User

Untitled

a guest
Dec 12th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.57 KB | None | 0 0
  1. if(strcmp(cmd, "/vpark", true) == 0)
  2. {
  3.     new Float:x,Float:y,Float:z;
  4.     new Float:a;
  5.     new carid;
  6.     new getcarid;
  7.     if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
  8.     else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
  9.     else { return 1; }
  10.     getcarid = GetPlayerVehicleID(playerid);
  11.     GetPlayerName(playerid, playername, sizeof(playername));
  12.     GetVehiclePos(carid, x, y, z);
  13.     GetVehicleZAngle(carid, a);
  14.     if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
  15.     {
  16.         if(PlayerInfo[playerid][pPcarkey] == 9999  && PlayerInfo[playerid][pPcarkey2] == 9999)
  17.         {
  18.             SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
  19.             return 1;
  20.         }
  21.         if(getcarid == carid)
  22.         {
  23.             CarInfo[carid][cLocationx] = x;
  24.             CarInfo[carid][cLocationy] = y;
  25.             CarInfo[carid][cLocationz] = z;
  26.             CarInfo[carid][cAngle] = a;
  27.             new area[35];
  28.             GetPlayer2DZone(playerid, area, sizeof(area));
  29.             OnPropUpdate(4,carid);
  30.             OnPlayerUpdateEx(playerid);
  31.             DestroyVehicle(carid);
  32.             ownedcar[carid] = CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz],CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
  33.             if(CarInfo[carid][cPaintjob] != 999)
  34.             {
  35.                 ChangeVehiclePaintjob(carid, CarInfo[carid][cPaintjob]);
  36.             }
  37.             if(CarInfo[carid][cPlate] != 999)
  38.             {
  39.                 SetVehicleNumberPlate(carid, CarInfo[carid][cPlate]);
  40.             }
  41.             if(CarInfo[carid][cLock] == 1)
  42.             {
  43.                 new e,l,a77,d77,b,bo,o;
  44.                 GetVehicleParamsEx(carid,e,l,a77,d77,b,bo,o);
  45.                 SetVehicleParamsEx(carid,e,l,a77,1,b,bo,o);
  46.             }
  47.             SetVehicleVirtualWorld(carid, CarInfo[carid][cVirWorld]);
  48.             SetVehicleModifications(carid);
  49.             TogglePlayerControllable(playerid, 1);
  50.             PutPlayerInVehicle(playerid, carid, 0);
  51.             new lights, alarm, doors, bonnet, boot, objective;
  52.             SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, lights, alarm, doors, bonnet, boot, objective);
  53.             engineOn[GetPlayerVehicleID(playerid)] = false;
  54.             gEngine[playerid] = 0;
  55.             return 1;
  56.             }
  57.         }
  58.         return 1;
  59.     }
Advertisement
Add Comment
Please, Sign In to add comment