Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.07 KB | None | 0 0
  1.  
  2. #include <a_samp>
  3. // hello i'll show you today how to create exit/enter for a shop
  4. // first of all we'll need to get the cordniates of this shop so we can open it
  5. // we can get it through getting in game and typing /save <name> and we'll have it in a txt file in Documents Gta san andreas files
  6. // savedpositions.txt
  7. // i've opened a bare script on the localhost to get the cordnitaes you can open it too :)
  8. // now we get the cord of it now lets check it
  9. /*
  10. AddPlayerClass(265,2157.1899,943.3493,10.8203,268.2549,0,0,0,0,0,0); // EnterAmmu
  11. AddPlayerClass(265,286.1330,-82.8946,1001.5156,173.1749,0,0,0,0,0,0); // ExitAmmu we will neeed only the x.y.z
  12. // we're going to create a pickup in OnGamemodeinit
  13. */
  14. #if defined FILTERSCRIPT
  15. new ammuenterpickup;// here we type the name of the pickup that we're going to use i'll show you
  16. new ammuexitpickup;
  17.  
  18. }
  19. public OnGameModeInit()// after we've done the pickups, we will have to do, what the player will get teleported to if he entered it?
  20. {
  21. ammuenterpickup= CreatePickup(1318,1,2157.1899,943.3493,10.8203);// here we're creating the pikcups, using CreatePickup(playerid, modelid,type,x,y,z);
  22. ammuexitpickup= CreatePickup(1318,1,286.1330,-82.8946,1001.5156);// we do the same here
  23. return 1;
  24. }
  25.  
  26. public OnGameModeExit()
  27. {
  28. return 1;
  29. }
  30.  
  31. public OnPlayerRequestClass(playerid, classid)
  32. {
  33. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  34. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  35. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  36. return 1;
  37. }
  38.  
  39. public OnPlayerConnect(playerid)
  40. {
  41. return 1;
  42. }
  43.  
  44. public OnPlayerDisconnect(playerid, reason)
  45. {
  46. return 1;
  47. }
  48.  
  49. public OnPlayerSpawn(playerid)
  50. {
  51. return 1;
  52. }
  53.  
  54. public OnPlayerDeath(playerid, killerid, reason)
  55. {
  56. return 1;
  57. }
  58.  
  59. public OnVehicleSpawn(vehicleid)
  60. {
  61. return 1;
  62. }
  63.  
  64. public OnVehicleDeath(vehicleid, killerid)
  65. {
  66. return 1;
  67. }
  68.  
  69. public OnPlayerText(playerid, text[])
  70. {
  71. return 1;
  72. }
  73.  
  74. public OnPlayerCommandText(playerid, cmdtext[])
  75. {
  76. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  77. {
  78. // Do something here
  79. return 1;
  80. }
  81. return 0;
  82. }
  83.  
  84. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  85. {
  86. return 1;
  87. }
  88.  
  89. public OnPlayerExitVehicle(playerid, vehicleid)
  90. {
  91. return 1;
  92. }
  93.  
  94. public OnPlayerStateChange(playerid, newstate, oldstate)
  95. {
  96. return 1;
  97. }
  98.  
  99. public OnPlayerEnterCheckpoint(playerid)
  100. {
  101. return 1;
  102. }
  103.  
  104. public OnPlayerLeaveCheckpoint(playerid)
  105. {
  106. return 1;
  107. }
  108.  
  109. public OnPlayerEnterRaceCheckpoint(playerid)
  110. {
  111. return 1;
  112. }
  113.  
  114. public OnPlayerLeaveRaceCheckpoint(playerid)
  115. {
  116. return 1;
  117. }
  118.  
  119. public OnRconCommand(cmd[])
  120. {
  121. return 1;
  122. }
  123.  
  124. public OnPlayerRequestSpawn(playerid)
  125. {
  126. return 1;
  127. }
  128.  
  129. public OnObjectMoved(objectid)
  130. {
  131. return 1;
  132. }
  133.  
  134. public OnPlayerObjectMoved(playerid, objectid)
  135. {
  136. return 1;
  137. }
  138. /*
  139. AddPlayerClass(265,2157.1899,943.3493,10.8203,268.2549,0,0,0,0,0,0); // EnterAmmu
  140. AddPlayerClass(265,286.1330,-82.8946,1001.5156,173.1749,0,0,0,0,0,0); // ExitAmmu we will neeed only the x.y.z
  141. // we're going to create a pickup in OnGamemodeinit
  142. */
  143. public OnPlayerPickUpPickup(playerid, pickupid)
  144. {
  145. if(pickupid== ammuenterpickup)// now let me explain here we check if the player standing on pickup ammuenterpickup what will happen to him?
  146. {
  147. SetPlayerInterior(playerid,4);// we will put him in a specfic interior id lets get the interior id for example this one also we've put him in the interior id 4
  148. SetPlayerPos(playerid,286.1330,-82.8946,1001.5156,173);// here we teleported the player to the exit pickup so the player will be in the interior cordinates
  149. // we will put him in a specfic place that we've taken by /save
  150. // entry pickup is done
  151. }
  152. if(pickupid == ammuexitpickup)
  153. {
  154. SetPlayerInterior(playerid,0);// here is the exitpickup, we'll put the player to the interior 0 the interior that he came from
  155. SetPlayerPos(playerid,2157.1899,943.3493,10.8203);// here we will put the cordinates of the entry pickup so the player will be teleported to
  156. }
  157. return 1;
  158. }
  159.  
  160. public OnVehicleMod(playerid, vehicleid, componentid)
  161. {
  162. return 1;
  163. }
  164.  
  165. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  166. {
  167. return 1;
  168. }
  169.  
  170. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  171. {
  172. return 1;
  173. }
  174.  
  175. public OnPlayerSelectedMenuRow(playerid, row)
  176. {
  177. return 1;
  178. }
  179.  
  180. public OnPlayerExitedMenu(playerid)
  181. {
  182. return 1;
  183. }
  184.  
  185. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  186. {
  187. return 1;
  188. }
  189.  
  190. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  191. {
  192. return 1;
  193. }
  194.  
  195. public OnRconLoginAttempt(ip[], password[], success)
  196. {
  197. return 1;
  198. }
  199.  
  200. public OnPlayerUpdate(playerid)
  201. {
  202. return 1;
  203. }
  204.  
  205. public OnPlayerStreamIn(playerid, forplayerid)
  206. {
  207. return 1;
  208. }
  209.  
  210. public OnPlayerStreamOut(playerid, forplayerid)
  211. {
  212. return 1;
  213. }
  214.  
  215. public OnVehicleStreamIn(vehicleid, forplayerid)
  216. {
  217. return 1;
  218. }
  219.  
  220. public OnVehicleStreamOut(vehicleid, forplayerid)
  221. {
  222. return 1;
  223. }
  224.  
  225. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  226. {
  227. return 1;
  228. }
  229.  
  230. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  231. {
  232. return 1;
  233. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement