Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.32 KB | None | 0 0
  1. CMD:rlock(playerid)
  2. {
  3.     if(GetPVarInt(playerid, "Rent") == 0) return SCM(playerid, COLOR_GREY, "Вы не арендуете транспортное средство!");
  4.     new vehicleid = GetPlayerVehicleID(playerid);
  5.     new lockstatus = gCarLock[vehicleid];
  6.     new Float:cx,Float:cy,Float:cz;
  7.     GetVehiclePos(vehicleid, cx, cy, cz);
  8.     switch (lockstatus)
  9.     {
  10.     case 0:
  11.         {
  12.             if(PlayerToPoint(4.0, playerid, cx, cy, cz))
  13.             {
  14.                     GameTextForPlayer(playerid, "~r~Locked", 1000, 4);
  15.                     PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  16.                     LockCar(vehicleid);
  17.                     IsLocked[playerid] = 1;
  18.                     gCarLock[playerid] = 1;
  19.                     GetVehicleParamsEx(GetPVarInt(playerid, "Rent"),engine,lights,alarm,doors,bonnet,boot,objective);
  20.                     SetVehicleParamsEx(GetPVarInt(playerid, "Rent"),engine,lights,alarm,true,bonnet,boot,objective);
  21.             }
  22.         }
  23.     case 1:
  24.         {
  25.             if(PlayerToPoint(4.0, playerid, cx, cy, cz))
  26.             {
  27.                     GameTextForPlayer(playerid, "~g~Locked", 1000, 4);
  28.                     PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  29.                     gCarLock[playerid] = 0;
  30.                     UnLockCar(vehicleid);
  31.                     IsLocked[playerid] = 0;
  32.                     GetVehicleParamsEx(GetPVarInt(playerid, "Rent"),engine,lights,alarm,doors,bonnet,boot,objective);
  33.                     SetVehicleParamsEx(GetPVarInt(playerid, "Rent"),engine,lights,alarm,false,bonnet,boot,objective);
  34.             }
  35.         }
  36.     }
  37.     return 1;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement