Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.46 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. SendClientMessage(playerid,0x0,"yeh i know xD /q the GM fails xD");
  66. return 1;
  67. }
  68.  
  69.  
  70. public OnPlayerCommandText(playerid, cmdtext[])
  71. {
  72. if(strcmp(cmdtext, "/opengate1", true) == 0)
  73. {
  74. if(gTeam[playerid] == 0)
  75. if(IsPlayerInRangeOfPoint(playerid, 1, -1544.8187, -443.3832, 6.1000, 39.2091))
  76. MoveObject(gate, -1545.7198486328, -430.60092163086, 10.721339225769, 7.0);
  77. return 1;
  78. }
  79.  
  80. if(strcmp(cmdtext, "/closegate1", true) == 0)
  81. {
  82. if(gTeam[playerid] == 0)
  83. if(IsPlayerInRangeOfPoint(playerid, 1, -1544.8187, -443.3832, 6.1000, 39.2091))
  84. MoveObject(gate, -1545.6732177734, -430.65551757813, 6.7213397026062, 7.0);
  85. return 1;
  86. }
  87.  
  88. if(strcmp(cmdtext, "/enter", true) == 0)
  89. {
  90. if(gTeam[playerid] == 0)
  91.  
  92. else
  93. {
  94. SendClientMessage(playerid, 0xFF0000AA, "Player not found");
  95. }
  96.  
  97. if(IsPlayerInRangeOfPoint(playerid, 1, -1544.0183, -446.6571, 6.0068))
  98. SetPlayerPos(playerid, -1543.5156,-446.1675,6.1000);
  99. return 1;
  100. }
  101.  
  102. if(strcmp(cmdtext, "/exit", true) == 0)
  103. {
  104. if(gTeam[playerid] == 0)
  105. if(IsPlayerInRangeOfPoint(playerid, 1, -1543.5156,-446.1675,6.1000))
  106. SetPlayerPos(playerid, -1544.0183, -446.6571, 6.0068);
  107. return 1;
  108. }
  109. return 0;
  110.  
  111. }
  112.  
  113.  
  114. public OnPlayerSpawn(playerid)
  115. {
  116. return 1;
  117. }
  118.  
  119. public OnPlayerDeath(playerid, killerid, reason)
  120. {
  121. return 1;
  122. }
  123.  
  124. public OnPlayerText(playerid, text[])
  125. {
  126. return 1;
  127. }
  128.  
  129.  
  130. public SetPlayerTeamFromClass(playerid, classid)
  131. {
  132. switch(classid)
  133. {
  134. case 0:
  135. {
  136. gTeam[playerid] = 0;
  137. GameTextForPlayer(playerid, "~r~Security", 5000, 5);
  138. }
  139. case 1:
  140. {
  141. gTeam[playerid] = 1;
  142. GameTextForPlayer(playerid, "~r~Civilion", 5000, 5);
  143. }
  144. }
  145. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement