SHOW:
|
|
- or go back to the newest paste.
1 | if(strcmp(cmd, "/vpark", true) == 0) | |
2 | { | |
3 | new ticks = tickcount(); | |
4 | new Float:x,Float:y,Float:z; | |
5 | new Float:a; | |
6 | new carid; | |
7 | new getcarid; | |
8 | if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; } | |
9 | else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; } | |
10 | else { return 1; } | |
11 | getcarid = GetPlayerVehicleID(playerid); | |
12 | GetPlayerName(playerid, playername, sizeof(playername)); | |
13 | GetVehiclePos(carid, x, y, z); | |
14 | GetVehicleZAngle(carid, a); | |
15 | if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1) | |
16 | { | |
17 | if(PlayerInfo[playerid][pPcarkey] == 9999 && PlayerInfo[playerid][pPcarkey2] == 9999) | |
18 | { | |
19 | SendClientMessage(playerid, COLOR_GREY, "You don't own a car."); | |
20 | return 1; | |
21 | } | |
22 | if(getcarid == carid) | |
23 | { | |
24 | CarInfo[carid][cLocationx] = x; | |
25 | CarInfo[carid][cLocationy] = y; | |
26 | CarInfo[carid][cLocationz] = z; | |
27 | CarInfo[carid][cAngle] = a; | |
28 | new area[35]; | |
29 | GetPlayer2DZone(playerid, area, sizeof(area)); | |
30 | OnPropUpdate(4,carid); | |
31 | OnPlayerUpdateEx(playerid); | |
32 | DestroyVehicle(carid); | |
33 | 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); | |
34 | if(CarInfo[carid][cPaintjob] != 999) | |
35 | { | |
36 | ChangeVehiclePaintjob(carid, CarInfo[carid][cPaintjob]); | |
37 | } | |
38 | if(CarInfo[carid][cPlate] != 999) | |
39 | { | |
40 | SetVehicleNumberPlate(carid, CarInfo[carid][cPlate]); | |
41 | } | |
42 | if(CarInfo[carid][cLock] == 1) | |
43 | { | |
44 | new e,l,a77,d77,b,bo,o; | |
45 | GetVehicleParamsEx(carid,e,l,a77,d77,b,bo,o); | |
46 | SetVehicleParamsEx(carid,e,l,a77,1,b,bo,o); | |
47 | } | |
48 | SetVehicleVirtualWorld(carid, CarInfo[carid][cVirWorld]); | |
49 | SetVehicleModifications(carid); | |
50 | TogglePlayerControllable(playerid, 1); | |
51 | PutPlayerInVehicle(playerid, carid, 0); | |
52 | new lights, alarm, doors, bonnet, boot, objective; | |
53 | SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, lights, alarm, doors, bonnet, boot, objective); | |
54 | engineOn[GetPlayerVehicleID(playerid)] = false; | |
55 | gEngine[playerid] = 0; | |
56 | return 1; | |
57 | } | |
58 | - | return 1; |
58 | + | } |
59 | - | } |
59 | + | printf("%i - command", tickcount() - ticks); |
60 | return 1; | |
61 | } |