Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.40 KB | None | 0 0
  1.  
  2. #include <a_samp>
  3. #define TEAM1 0
  4. #define TEAM2 1
  5.  
  6.  
  7. new gTeam[MAX_PLAYERS];
  8. new gate;
  9.  
  10. forward SetPlayerTeamFromClass(playerid, classid);
  11.  
  12. public OnGameModeInit()
  13. {
  14. SetGameModeText("SA-AIRLINES SECURITY DEMO :D");
  15. //skins,classes....
  16. AddPlayerClass(71, -1545.2791, -448.4932,6.0068, 231.3076, 0, 0, 0, 0, 0, 0);// security
  17. AddPlayerClass(29, -1545.2791, -448.4932,6.0068, 269.1425, 0, 0, 0, 0, 0, 0);//civilion
  18. //= lol
  19. gate = CreateObject(7657, -1545.6732177734, -430.65551757813, 6.7213397026062, 0, 0, 316);
  20. //objects
  21. CreateObject(2922, -1545.0002441406, -443.06915283203, 5.6424250602722, 0, 2, 222);
  22. //vehicles
  23. AddStaticVehicleEx(583,-1534.56896973,-445.33132935,5.42359400,256.00000000,-1,2,15); //Tug
  24. AddStaticVehicleEx(583,-1528.60351562,-450.42242432,5.41502237,255.99792480,-1,2,15); //Tug
  25. AddStaticVehicleEx(583,-1531.53198242,-447.91894531,5.45144415,255.99792480,-1,1,15); //Tug
  26. AddStaticVehicleEx(583,-1525.61035156,-453.03411865,5.40000010,255.99792480,-1,1,15); //Tug
  27. AddStaticVehicleEx(583,-1522.17968750,-455.51168823,5.40000010,255.99792480,-1,2,15); //Tug
  28. AddStaticVehicleEx(583,-1518.90283203,-457.72406006,5.40000010,255.99792480,-1,1,15); //Tug
  29. AddStaticVehicleEx(583,-1516.12121582,-460.05581665,5.40000010,255.99792480,-1,2,15); //Tug
  30. AddStaticVehicleEx(583,-1512.95678711,-462.37921143,5.40000010,255.99792480,-1,1,15); //Tug
  31. //text
  32. Create3DTextLabel("/enter To Enter The Building", 0x008080FF, -1544.0183, -446.6571, 6.0068 , 20.0, 0, 1);
  33. Create3DTextLabel("/exit To Exit The Building", 0x008080FF, -1543.5156, -446.1675, 6.1000 , 20.0, 0, 1);
  34. Create3DTextLabel("/opengate1 And /closegate1 To Open And Close The Gate", 0x008080FF, -1544.8187, -443.3832, 6.1000, 20.0, 0, 1);
  35.  
  36. return 1;
  37. }
  38.  
  39. public OnGameModeExit()
  40. {
  41. return 1;
  42. }
  43.  
  44. public OnPlayerRequestClass(playerid, classid)
  45. {
  46. SetPlayerTeamFromClass(playerid, classid);
  47. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  48. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  49. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  50. return 1;
  51. }
  52.  
  53. public OnPlayerConnect(playerid)
  54. {
  55. new string[85],pname[24];
  56. GetPlayerName(playerid,pname,24);
  57. format(string,sizeof(string),"%s [%d] Has Joined The Server!",pname,playerid);
  58. SendClientMessageToAll(0x0,string);
  59. SendClientMessage(playerid,0xEF4300,"sa-airlines security demo:D");
  60. return 1;
  61. }
  62.  
  63. public OnPlayerDisconnect(playerid, reason)
  64. {
  65. return 1;
  66. }
  67.  
  68.  
  69. public OnPlayerCommandText(playerid, cmdtext[])
  70. {
  71. if(strcmp(cmdtext, "/opengate1", true) == 0)
  72. {
  73. if(gTeam[playerid] == 0)
  74. if(IsPlayerInRangeOfPoint(playerid, 1, -1544.8187, -443.3832, 6.1000, 39.2091))
  75. MoveObject(gate, -1545.7198486328, -430.60092163086, 10.721339225769, 7.0);
  76. return 1;
  77. }
  78.  
  79. if(strcmp(cmdtext, "/closegate1", true) == 0)
  80. {
  81. if(gTeam[playerid] == 0)
  82. if(IsPlayerInRangeOfPoint(playerid, 1, -1544.8187, -443.3832, 6.1000, 39.2091))
  83. MoveObject(gate, -1545.6732177734, -430.65551757813, 6.7213397026062, 7.0);
  84. return 1;
  85. }
  86.  
  87. if(strcmp(cmdtext, "/enter", true) == 0)
  88. {
  89. if(gTeam[playerid] == 0)
  90.  
  91. else
  92. {
  93. SendClientMessage(playerid, 0xFF0000AA, "You Dont Have The Key.");
  94. }
  95.  
  96. if(IsPlayerInRangeOfPoint(playerid, 1, -1544.0183, -446.6571, 6.0068))
  97. SetPlayerPos(playerid, -1543.5156,-446.1675,6.1000);
  98. return 1;
  99. }
  100.  
  101. if(strcmp(cmdtext, "/exit", true) == 0)
  102. {
  103. if(gTeam[playerid] == 0)
  104. if(IsPlayerInRangeOfPoint(playerid, 1, -1543.5156,-446.1675,6.1000))
  105. SetPlayerPos(playerid, -1544.0183, -446.6571, 6.0068);
  106. return 1;
  107. }
  108. return 0;
  109.  
  110. }
  111.  
  112.  
  113. public OnPlayerSpawn(playerid)
  114. {
  115. return 1;
  116. }
  117.  
  118. public OnPlayerDeath(playerid, killerid, reason)
  119. {
  120. return 1;
  121. }
  122.  
  123. public OnPlayerText(playerid, text[])
  124. {
  125. return 1;
  126. }
  127.  
  128.  
  129. public SetPlayerTeamFromClass(playerid, classid)
  130. {
  131. switch(classid)
  132. {
  133. case 0:
  134. {
  135. gTeam[playerid] = 0;
  136. GameTextForPlayer(playerid, "~r~Security", 5000, 5);
  137. }
  138. case 1:
  139. {
  140. gTeam[playerid] = 1;
  141. GameTextForPlayer(playerid, "~r~Civilion", 5000, 5);
  142. }
  143. }
  144. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement