Advertisement
Guest User

John9815

a guest
Feb 27th, 2009
3,225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. // This is a comment
  4. // uncomment the line below if you want to write a filterscript
  5. //#define FILTERSCRIPT
  6.  
  7. #if defined FILTERSCRIPT
  8.  
  9. public OnFilterScriptInit()
  10. {
  11. print("\n--------------------------------------");
  12. print("Locking/Unlocking Car System by John9815 Loaded.");
  13. print("--------------------------------------\n");
  14. return 1;
  15. }
  16.  
  17. public OnFilterScriptExit()
  18. {
  19. return 1;
  20. }
  21.  
  22. #else
  23.  
  24. main()
  25. {
  26. print("\n----------------------------------");
  27. print(" Blank Gamemode by your name here");
  28. print("----------------------------------\n");
  29. }
  30.  
  31. #endif
  32.  
  33. public OnGameModeInit()
  34. {
  35. // Don't use these lines if it's a filterscript
  36. SetGameModeText("Blank Script");
  37. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  38. return 1;
  39. }
  40.  
  41. public OnGameModeExit()
  42. {
  43. return 1;
  44. }
  45.  
  46. public OnPlayerRequestClass(playerid, classid)
  47. {
  48. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  49. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  50. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  51. return 1;
  52. }
  53.  
  54. public OnPlayerRequestSpawn(playerid)
  55. {
  56. return 1;
  57. }
  58.  
  59. public OnPlayerConnect(playerid)
  60. {
  61. return 1;
  62. }
  63.  
  64. public OnPlayerDisconnect(playerid, reason)
  65. {
  66. return 1;
  67. }
  68.  
  69. public OnPlayerSpawn(playerid)
  70. {
  71. return 1;
  72. }
  73.  
  74. public OnPlayerDeath(playerid, killerid, reason)
  75. {
  76. return 1;
  77. }
  78.  
  79. public OnVehicleSpawn(vehicleid)
  80. {
  81. return 1;
  82. }
  83.  
  84. public OnVehicleDeath(vehicleid, killerid)
  85. {
  86. return 1;
  87. }
  88.  
  89. public OnPlayerText(playerid, text[])
  90. {
  91. return 1;
  92. }
  93.  
  94. public OnPlayerPrivmsg(playerid, recieverid, text[])
  95. {
  96. return 1;
  97. }
  98.  
  99. public OnPlayerCommandText(playerid, cmdtext[])
  100. {
  101. if (strcmp(cmdtext, "/lock", true)==0)
  102. {
  103. if(IsPlayerInAnyVehicle(playerid))
  104. {
  105. new State=GetPlayerState(playerid);
  106. if(State!=PLAYER_STATE_DRIVER)
  107. {
  108. SendClientMessage(playerid,0xFF004040,"You can only lock the doors as the driver.");
  109. return 1;
  110. }
  111. new i;
  112. for(i=0;i<MAX_PLAYERS;i++)
  113. {
  114. if(i != playerid)
  115. {
  116. SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
  117. }
  118. }
  119. SendClientMessage(playerid, 0x33AA33AA, "Vehicle locked!");
  120. new Float:pX, Float:pY, Float:pZ;
  121. GetPlayerPos(playerid,pX,pY,pZ);
  122. PlayerPlaySound(playerid,1056,pX,pY,pZ);
  123. }
  124. else
  125. {
  126. SendClientMessage(playerid, 0xFF004040, "You're not in a vehicle!");
  127. }
  128. return 1;
  129. }
  130. if (strcmp(cmdtext, "/unlock", true)==0)
  131. {
  132. if(IsPlayerInAnyVehicle(playerid))
  133. {
  134. new State=GetPlayerState(playerid);
  135. if(State!=PLAYER_STATE_DRIVER)
  136. {
  137. SendClientMessage(playerid,0xFF004040,"You can only unlock the doors as the driver.");
  138. return 1;
  139. }
  140. new i;
  141. for(i=0;i<MAX_PLAYERS;i++)
  142. {
  143. SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
  144. }
  145. SendClientMessage(playerid, 0x33AA33AA, "Vehicle unlocked!");
  146. new Float:pX, Float:pY, Float:pZ;
  147. GetPlayerPos(playerid,pX,pY,pZ);
  148. PlayerPlaySound(playerid,1057,pX,pY,pZ);
  149. }
  150. else
  151. {
  152. SendClientMessage(playerid, 0xFF004040, "You're not in a vehicle!");
  153. }
  154. return 1;
  155. }
  156. return 0;
  157. }
  158.  
  159. public OnPlayerInfoChange(playerid)
  160. {
  161. return 1;
  162. }
  163.  
  164. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  165. {
  166. return 1;
  167. }
  168.  
  169. public OnPlayerExitVehicle(playerid, vehicleid)
  170. {
  171. return 1;
  172. }
  173.  
  174. public OnPlayerStateChange(playerid, newstate, oldstate)
  175. {
  176. return 1;
  177. }
  178.  
  179. public OnPlayerEnterCheckpoint(playerid)
  180. {
  181. return 1;
  182. }
  183.  
  184. public OnPlayerLeaveCheckpoint(playerid)
  185. {
  186. return 1;
  187. }
  188.  
  189. public OnPlayerEnterRaceCheckpoint(playerid)
  190. {
  191. return 1;
  192. }
  193.  
  194. public OnPlayerLeaveRaceCheckpoint(playerid)
  195. {
  196. return 1;
  197. }
  198.  
  199. public OnRconCommand(cmd[])
  200. {
  201. return 1;
  202. }
  203.  
  204. public OnObjectMoved(objectid)
  205. {
  206. return 1;
  207. }
  208.  
  209. public OnPlayerObjectMoved(playerid, objectid)
  210. {
  211. return 1;
  212. }
  213.  
  214. public OnPlayerPickUpPickup(playerid, pickupid)
  215. {
  216. return 1;
  217. }
  218.  
  219. public OnPlayerSelectedMenuRow(playerid, row)
  220. {
  221. return 1;
  222. }
  223.  
  224. public OnPlayerExitedMenu(playerid)
  225. {
  226. return 1;
  227. }
  228.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement