Guest User

KmanN

a guest
Feb 19th, 2009
522
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.04 KB | None | 0 0
  1. //***********| Admin Objects Coded By |********************//
  2. //*******************| By KmanN |************************//
  3.  
  4. #include <a_samp>
  5.  
  6. new ShipObject [MAX_PLAYERS], FlareObject [MAX_PLAYERS], SharkObject [MAX_PLAYERS], FogObject [MAX_PLAYERS], TurtleObject [MAX_PLAYERS], BushObject [MAX_PLAYERS];
  7. new ShipEnabled[MAX_PLAYERS], FlareEnabled[MAX_PLAYERS], SharkEnabled[MAX_PLAYERS], FogEnabled[MAX_PLAYERS], TurtleEnabled[MAX_PLAYERS], BushEnabled[MAX_PLAYERS];
  8. #pragma tabsize 0 // Removes loose indentation warnings
  9.  
  10. public OnFilterScriptInit()
  11. {
  12.  
  13. print( "\n--------------------------------------" );
  14. print( " Admin Object FS By KmanN ");
  15. print( "--------------------------------------\n" );
  16. return 1;
  17. }
  18.  
  19. public OnFilterScriptExit()
  20. {
  21. return 1;
  22. }
  23.  
  24. public OnPlayerConnect( playerid )
  25. {
  26. ShipEnabled [playerid] = false;
  27. FlareEnabled[playerid] = false;
  28. SharkEnabled[playerid] = false;
  29. FogEnabled[playerid] = false;
  30. TurtleEnabled[playerid] = false;
  31. BushEnabled[playerid] = false;
  32. return 1;
  33. }
  34.  
  35. public OnPlayerDisconnect( playerid, reason )
  36. {
  37. if ( ShipEnabled[playerid] )
  38. DestroyObject( ShipObject[playerid] );
  39.  
  40. if ( FlareEnabled[playerid] )
  41. DestroyObject( FlareObject[playerid] );
  42.  
  43. if ( SharkEnabled[playerid] )
  44. DestroyObject( SharkObject[playerid] );
  45.  
  46. if ( FogEnabled[playerid] )
  47. DestroyObject( FogObject[playerid] );
  48.  
  49. if ( TurtleEnabled[playerid] )
  50. DestroyObject( TurtleObject[playerid] );
  51.  
  52. if (BushEnabled[playerid] )
  53. DestroyObject( BushObject[playerid] );
  54.  
  55. return 1;
  56. }
  57.  
  58. public OnPlayerCommandText( playerid, cmdtext[] )
  59. {
  60. if ( !strcmp( "/ship", cmdtext, true, 7 ) )
  61. {
  62. if (!IsPlayerAdmin(playerid) && CallRemoteFunction("GetPlayerLevel","i",playerid) < 5) return 0;
  63. else
  64. if ( ShipEnabled[playerid] )
  65. {
  66. DestroyObject( ShipObject[playerid] );
  67. DestroyObject( FogObject[playerid] );
  68. SendClientMessage(playerid, 0xDEEE20FF, "The Ghost Ship is Disabled.");
  69. ShipEnabled[playerid] = false;
  70. FogEnabled[playerid] = false;
  71.  
  72. return 1;
  73. }
  74. FogObject [playerid] = CreateObject( 2780, 0, 0, 0, 0, 0, 0 );
  75. FogEnabled[playerid] = true;
  76. ShipObject [playerid] = CreateObject( 8493, 0, 0, 0, 0, 0, 0 );
  77. ShipEnabled[playerid] = true;
  78. SendClientMessage(playerid, 0xDEEE20FF, "The Ghost Ship is Enabled.");
  79. AttachObjectToPlayer( ShipObject[playerid], playerid, 0, 0, 15, 0, 0, 0 );
  80. AttachObjectToPlayer( FogObject[playerid], playerid, 0, 2, 3, 0, 0, 0 );
  81. AttachObjectToPlayer( FogObject[playerid], playerid, 0, 10, 3, 0, 0, 0 );
  82. AttachObjectToPlayer( FogObject[playerid], playerid, 0, -2, 3, 0, 0, 0 );
  83. AttachObjectToPlayer( FogObject[playerid], playerid, 0, -10, 3, 0, 0, 0 );
  84. return 1;
  85. }
  86.  
  87. if ( !strcmp( "/flare", cmdtext, true ) )
  88. {
  89. if (!IsPlayerAdmin(playerid) && CallRemoteFunction("GetPlayerLevel","i",playerid) < 3) return 0;
  90. else
  91. if ( FlareEnabled[playerid] )
  92. {
  93. DestroyObject( FlareObject[playerid] );
  94. SendClientMessage(playerid, 0xDEEE20FF, "The Flare is Disabled.");
  95. FlareEnabled[playerid] = false;
  96.  
  97. return 1;
  98. }
  99. FlareObject [playerid] = CreateObject( 354, 0, 0, 0, 0, 0, 0 );
  100. FlareEnabled[playerid] = true;
  101. SendClientMessage(playerid, 0xDEEE20FF, "The Flare is Enabled.");
  102. AttachObjectToPlayer( FlareObject[playerid], playerid, 0, 0, 0, 0, 0, 0 );
  103. return 1;
  104. }
  105.  
  106. if ( !strcmp( "/shark", cmdtext, true ) )
  107. {
  108. if (!IsPlayerAdmin(playerid) && CallRemoteFunction("GetPlayerLevel","i",playerid) < 3) return 0;
  109. else
  110. if ( SharkEnabled[playerid] )
  111. {
  112. DestroyObject( SharkObject[playerid] );
  113. SendClientMessage(playerid, 0xDEEE20FF, "The Shark is Disabled.");
  114. SharkEnabled[playerid] = false;
  115. return 1;
  116. }
  117.  
  118. SharkObject [playerid] = CreateObject( 1608, 0, 0, 0, 0, 0, 0 );
  119. SharkEnabled[playerid] = true;
  120. SendClientMessage(playerid, 0xDEEE20FF, "The Shark is Enabled.");
  121. AttachObjectToPlayer( SharkObject[playerid], playerid, 0, 0, 0, 0, 0, 0 );
  122. return 1;
  123. }
  124.  
  125. if ( !strcmp( "/fog", cmdtext, true ) )
  126. {
  127. if (!IsPlayerAdmin(playerid) && CallRemoteFunction("GetPlayerLevel","i",playerid) < 3) return 0;
  128. else
  129. if ( FogEnabled[playerid] )
  130. {
  131. DestroyObject( FogObject[playerid] );
  132. SendClientMessage(playerid, 0xDEEE20FF, "The Fog is Disabled.");
  133. FogEnabled[playerid] = false;
  134. return 1;
  135. }
  136.  
  137. FogObject [playerid] = CreateObject( 2780, 0, 0, 0, 0, 0, 0 );
  138. FogEnabled[playerid] = true;
  139. SendClientMessage(playerid, 0xDEEE20FF, "The Fog is Enabled.");
  140. AttachObjectToPlayer( FogObject[playerid], playerid, 0, 0, -3, 0, 0, 0 );
  141. return 1;
  142. }
  143.  
  144. if ( !strcmp( "/turtle", cmdtext, true ) )
  145. {
  146. if (!IsPlayerAdmin(playerid) && CallRemoteFunction("GetPlayerLevel","i",playerid) < 3) return 0;
  147. else
  148. if ( TurtleEnabled[playerid] )
  149. {
  150. DestroyObject( TurtleObject[playerid] );
  151. SendClientMessage(playerid, 0xDEEE20FF, "The Turtle is Disabled.");
  152. TurtleEnabled[playerid] = false;
  153. return 1;
  154. }
  155. TurtleObject [playerid] = CreateObject( 1609, 0, 0, 0, 0, 0, 0 );
  156. TurtleEnabled[playerid] = true;
  157. SendClientMessage(playerid, 0xDEEE20FF, "The Turtle is Enabled.");
  158. AttachObjectToPlayer( TurtleObject[playerid], playerid, 0, 0, 0, 0, 0, 0 );
  159. return 1;
  160. }
  161.  
  162. if ( !strcmp( "/bush", cmdtext, true ) )
  163. {
  164. if (!IsPlayerAdmin(playerid) && CallRemoteFunction("GetPlayerLevel","i",playerid) < 0) return 0;
  165. else
  166. if ( BushEnabled[playerid] )
  167. {
  168. DestroyObject( BushObject[playerid] );
  169. SendClientMessage(playerid, 0xDEEE20FF, "The Bush is Disabled.");
  170. BushEnabled[playerid] = false;
  171. return 1;
  172. }
  173. BushObject [playerid] = CreateObject( 800, 0, 0, 0, 0, 0, 0 );
  174. BushEnabled[playerid] = true;
  175. SendClientMessage(playerid, 0xDEEE20FF, "The Bush is Enabled.");
  176. AttachObjectToPlayer( BushObject[playerid], playerid, 0, 0, 0, 0, 0, 0 );
  177. return 1;
  178. }
  179.  
  180. if ( !strcmp( "/object", cmdtext, true ) )
  181. {
  182. if (!IsPlayerAdmin(playerid) && CallRemoteFunction("GetPlayerLevel","i",playerid) < 3) return 0;
  183. else
  184. {
  185. SendClientMessage(playerid, 0xFF0000, "---------------Object list------------.");
  186. SendClientMessage(playerid, 0xFF0000, " /ship For A Ship.");
  187. SendClientMessage(playerid, 0xFF0000, " /shark For A Shark Object.");
  188. SendClientMessage(playerid, 0xFF0000, " /flare For A Hydra Flare.");
  189. SendClientMessage(playerid, 0xFF0000, " /Fog For A Smoke Machine.");
  190. SendClientMessage(playerid, 0xFF0000, " /Turtle For A Turtle.");
  191. SendClientMessage(playerid, 0xFF0000, " /Bush For A Bush.");
  192. }
  193. return 1;
  194. }
  195. return 0;
  196. }
  197.  
  198. public OnPlayerDeath(playerid, killerid, reason)
  199. {
  200. FogEnabled[playerid] = false;
  201. SharkEnabled[playerid] = false;
  202. FlareEnabled[playerid] = false;
  203. ShipEnabled[playerid] = false;
  204. TurtleEnabled[playerid] = false;
  205. BushEnabled[playerid] = false;
  206. return 1;
  207. }
  208.  
  209.  
Advertisement
Add Comment
Please, Sign In to add comment