Advertisement
Wizdo

[FS] Lift System [CREATE LIFTS ANYWHERE]

Aug 18th, 2014
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.86 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4. new lifts[MAX_PLAYERS];
  5. new IsLift[MAX_PLAYERS];
  6. public OnGameModeInit()
  7. {
  8.         return 1;
  9. }
  10.  
  11. public OnPlayerConnect(playerid)
  12. {
  13.     IsLift[playerid] = 0;
  14.     return 1;
  15. }
  16. public OnPlayerDisconnect(playerid, reason)
  17. {
  18.     IsLift[playerid] = 0;
  19.     return 1;
  20. }
  21.  
  22. CMD:getlift(playerid, params[])
  23. {
  24.     DestroyObject(lifts[playerid]);
  25.     new Float:X, Float:Y, Float:Z;
  26.     GetPlayerPos(playerid, X, Y, Z);
  27.     lifts[playerid] = CreateObject(16501, X, Y, Z-1,0,90,0);
  28.     SetPlayerPos(playerid,X,Y,Z+0.2);
  29.         IsLift[playerid] = 1;
  30.     return 1;
  31.     }
  32. CMD:liftup(playerid, params[])
  33.     {
  34.     if(IsLift[playerid] == 0) return SendClientMessage(playerid,0xC0C0C0C8,"You need to create a lift first!");
  35.     new Float:oX, Float:oY, Float:oZ;
  36.     new Float:RotX,Float:RotY,Float:RotZ;
  37.     GetObjectRot(lifts[playerid], RotX, RotY, RotZ);
  38.     GetObjectPos(lifts[playerid], oX, oY, oZ);
  39.     MoveObject(lifts[playerid],oX,oY,oZ+10,0.5,0,90,0);
  40.     return 1;
  41.     }
  42. CMD:liftdown(playerid, params[])
  43. {
  44.     if(IsLift[playerid] == 0) return SendClientMessage(playerid,0xC0C0C0C8,"You need to create a lift first!");
  45.     new Float:lX, Float:lY, Float:lZ;
  46.     new Float:RotsX,Float:RotsY,Float:RotsZ;
  47.     GetObjectRot(lifts[playerid], RotsX, RotsY, RotsZ);
  48.     GetObjectPos(lifts[playerid], lX, lY, lZ);
  49.     MoveObject(lifts[playerid],lX,lY,lZ-10,0.5,0,90,0);
  50.     return 1;
  51.     }
  52. CMD:stoplift(playerid, params[])
  53.     {
  54.     if(IsLift[playerid] == 0) return SendClientMessage(playerid,0xC0C0C0C8,"You need to create a lift first!");
  55.     StopObject(lifts[playerid]);
  56.     return 1;
  57.     }
  58. CMD:destroylift(playerid, params[])
  59.     {
  60.     if(IsLift[playerid] == 0) return SendClientMessage(playerid,0xC0C0C0C8,"You need to create a lift first!");
  61.     DestroyObject(lifts[playerid]);
  62.     IsLift[playerid] = 0;
  63.     return 1;
  64.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement