Guest User

cPickupMaker version 1.1

a guest
Jul 3rd, 2011
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.18 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4. #include <zcmd>
  5. #include <colors>
  6. #include <streamer>
  7. #include <sscanf>
  8.  
  9. #if defined FILTERSCRIPT
  10.  
  11. public OnFilterScriptInit()
  12. {
  13.     print("\n--------------------------------------");
  14.     print(" cPickupMaker - Credits: Luis.");
  15.     print("--------------------------------------\n");
  16.    
  17.     LoadStaticPickupsFromFile("Pickups.txt");
  18.     return 1;
  19. }
  20.  
  21. stock LoadStaticPickupsFromFile(filename[])
  22. {
  23.     new File:file_ptr, line[256], pickupid, modelid, Float:SpawnX, Float:SpawnY, Float:SpawnZ, objects_loaded;
  24.     file_ptr = fopen(filename, io_read);
  25.     if(!file_ptr) return printf("ERROR! Failed to load objects from the file %s (File doesn't exist in scriptfiles directory)!", filename);
  26.     while(fread(file_ptr, line) > 0)
  27.     {
  28.         if(!sscanf(line, "p<,>'('ddfffp<)>f", pickupid, modelid, SpawnX, SpawnY, SpawnZ))
  29.         {
  30.             CreatePickup(pickupid, modelid, SpawnX, SpawnY, SpawnZ, 0);
  31.             objects_loaded++;
  32.         }
  33.     }
  34.     fclose(file_ptr);
  35.     printf("Loaded %d objects from: %s", objects_loaded, filename);
  36.     return objects_loaded;
  37. }
  38.  
  39. public OnFilterScriptExit()
  40. {
  41.     print("cPickupMaker Unloaded.");
  42.     return 1;
  43. }
  44.  
  45.  
  46. #endif
  47.  
  48. public OnPlayerConnect(playerid)
  49. {
  50.     return 1;
  51. }
  52.  
  53. public OnPlayerSpawn(playerid)
  54. {
  55.     SendClientMessage(playerid, COLOR_LIGHTBLUE, "INFO: {1BA3CC}This server uses {C21BAE}cPickupMaker{1BA3CC}.");
  56.     return 1;
  57. }
  58.  
  59. public OnPlayerDeath(playerid, killerid, reason)
  60. {
  61.     return 1;
  62. }
  63.  
  64. public OnVehicleSpawn(vehicleid)
  65. {
  66.     return 1;
  67. }
  68.  
  69. public OnVehicleDeath(vehicleid, killerid)
  70. {
  71.     return 1;
  72. }
  73.  
  74. public OnPlayerText(playerid, text[])
  75. {
  76.     return 1;
  77. }
  78.  
  79. CMD:make(playerid, params[])
  80. {
  81.     new Float:Pos[3], string[128], pickup, style;
  82.     if(sscanf(params, "ii", pickup, style)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /make [pickupid] [modelid]");
  83.     else
  84.    
  85.     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  86.     CreatePickup(pickup, style, Pos[0], Pos[1], Pos[2], -1);
  87.     format(string, sizeof(string), "INFO: Pickup ID: %d has been created.", pickup);
  88.     SendClientMessageToAll(COLOR_LIGHTBLUE, string);
  89.    
  90.     new str[128];
  91.     new File:Pickup = fopen("Pickups.txt", io_append);
  92.     format(str, 128, "CreatePickup(%d, %d, %f, %f, %f, 0);\r\n", pickup, style, Pos[0], Pos[1], Pos[2]);
  93.     fwrite(Pickup, str);
  94.     fclose(Pickup);
  95.     return 1;
  96. }
  97.  
  98. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  99. {
  100.     return 1;
  101. }
  102.  
  103. public OnPlayerExitVehicle(playerid, vehicleid)
  104. {
  105.     return 1;
  106. }
  107.  
  108. public OnPlayerStateChange(playerid, newstate, oldstate)
  109. {
  110.     return 1;
  111. }
  112.  
  113. public OnPlayerEnterCheckpoint(playerid)
  114. {
  115.     return 1;
  116. }
  117.  
  118. public OnPlayerLeaveCheckpoint(playerid)
  119. {
  120.     return 1;
  121. }
  122.  
  123. public OnPlayerEnterRaceCheckpoint(playerid)
  124. {
  125.     return 1;
  126. }
  127.  
  128. public OnPlayerLeaveRaceCheckpoint(playerid)
  129. {
  130.     return 1;
  131. }
  132.  
  133. public OnRconCommand(cmd[])
  134. {
  135.     return 1;
  136. }
  137.  
  138. public OnPlayerRequestSpawn(playerid)
  139. {
  140.     return 1;
  141. }
  142.  
  143. public OnObjectMoved(objectid)
  144. {
  145.     return 1;
  146. }
  147.  
  148. public OnPlayerObjectMoved(playerid, objectid)
  149. {
  150.     return 1;
  151. }
  152.  
  153. public OnPlayerPickUpPickup(playerid, pickupid)
  154. {
  155.     return 1;
  156. }
  157.  
  158. public OnVehicleMod(playerid, vehicleid, componentid)
  159. {
  160.     return 1;
  161. }
  162.  
  163. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  164. {
  165.     return 1;
  166. }
  167.  
  168. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  169. {
  170.     return 1;
  171. }
  172.  
  173. public OnPlayerSelectedMenuRow(playerid, row)
  174. {
  175.     return 1;
  176. }
  177.  
  178. public OnPlayerExitedMenu(playerid)
  179. {
  180.     return 1;
  181. }
  182.  
  183. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  184. {
  185.     return 1;
  186. }
  187.  
  188. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  189. {
  190.     return 1;
  191. }
  192.  
  193. public OnRconLoginAttempt(ip[], password[], success)
  194. {
  195.     return 1;
  196. }
  197.  
  198. public OnPlayerUpdate(playerid)
  199. {
  200.     return 1;
  201. }
  202.  
  203. public OnPlayerStreamIn(playerid, forplayerid)
  204. {
  205.     return 1;
  206. }
  207.  
  208. public OnPlayerStreamOut(playerid, forplayerid)
  209. {
  210.     return 1;
  211. }
  212.  
  213. public OnVehicleStreamIn(vehicleid, forplayerid)
  214. {
  215.     return 1;
  216. }
  217.  
  218. public OnVehicleStreamOut(vehicleid, forplayerid)
  219. {
  220.     return 1;
  221. }
  222.  
  223. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  224. {
  225.     return 1;
  226. }
  227.  
  228. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  229. {
  230.     return 1;
  231. }
Advertisement
Add Comment
Please, Sign In to add comment