Advertisement
Guest User

Lo_Waffen Speichern/Laden

a guest
Jan 5th, 2012
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.67 KB | None | 0 0
  1. #include <a_samp>
  2. #include <dini>
  3.  
  4.  
  5. enum Waffen_Info
  6. {
  7. wslot,wslot1,wslot2,wslot3,wslot4,wslot5,wslot6,wslot7,wslot8,wslot9,wslot10,wslot11,
  8. aslot,aslot1,aslot2,aslot3,aslot4,aslot5,aslot6,aslot7,aslot8,aslot9,aslot10,aslot11
  9. };
  10. new wInfo[MAX_PLAYERS][Waffen_Info];
  11.  
  12. #if defined FILTERSCRIPT
  13.  
  14. public OnFilterScriptInit()
  15. {
  16. print("\n--------------------------------------");
  17. print(" Waffen Speichern/Laden by Sven");
  18. print("--------------------------------------\n");
  19. return 1;
  20. }
  21.  
  22. public OnFilterScriptExit()
  23. {
  24. return 1;
  25. }
  26.  
  27. #else
  28.  
  29.  
  30. main()
  31. {
  32. print("\n----------------------------------");
  33. print(" Waffen Speichern/Laden by Sven");
  34. print("----------------------------------\n");
  35. }
  36.  
  37. #endif
  38.  
  39. public OnGameModeInit()
  40. {
  41. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  42. return 1;
  43. }
  44.  
  45. public OnGameModeExit()
  46. {
  47. return 1;
  48. }
  49.  
  50. public OnPlayerRequestClass(playerid, classid)
  51. {
  52. return 1;
  53. }
  54.  
  55. public OnPlayerConnect(playerid)
  56. {
  57. return 1;
  58. }
  59.  
  60. public OnPlayerDisconnect(playerid, reason)
  61. {
  62. WaffenSpeichern(playerid);
  63. return 1;
  64. }
  65.  
  66. public OnPlayerSpawn(playerid)
  67. {
  68. WaffenLaden(playerid);
  69. GivePlayerWeapon(playerid,wInfo[playerid][wslot],wInfo[playerid][aslot]);
  70. GivePlayerWeapon(playerid,wInfo[playerid][wslot1],wInfo[playerid][aslot1]);
  71. GivePlayerWeapon(playerid,wInfo[playerid][wslot2],wInfo[playerid][aslot2]);
  72. GivePlayerWeapon(playerid,wInfo[playerid][wslot3],wInfo[playerid][aslot3]);
  73. GivePlayerWeapon(playerid,wInfo[playerid][wslot4],wInfo[playerid][aslot4]);
  74. GivePlayerWeapon(playerid,wInfo[playerid][wslot5],wInfo[playerid][aslot5]);
  75. GivePlayerWeapon(playerid,wInfo[playerid][wslot6],wInfo[playerid][aslot6]);
  76. GivePlayerWeapon(playerid,wInfo[playerid][wslot7],wInfo[playerid][aslot7]);
  77. GivePlayerWeapon(playerid,wInfo[playerid][wslot8],wInfo[playerid][aslot8]);
  78. GivePlayerWeapon(playerid,wInfo[playerid][wslot9],wInfo[playerid][aslot9]);
  79. GivePlayerWeapon(playerid,wInfo[playerid][wslot10],wInfo[playerid][aslot10]);
  80. GivePlayerWeapon(playerid,wInfo[playerid][wslot11],wInfo[playerid][aslot11]);
  81. return 1;
  82. }
  83.  
  84. public OnPlayerDeath(playerid, killerid, reason)
  85. {
  86. return 1;
  87. }
  88.  
  89. public OnVehicleSpawn(vehicleid)
  90. {
  91. return 1;
  92. }
  93.  
  94. public OnVehicleDeath(vehicleid, killerid)
  95. {
  96. return 1;
  97. }
  98.  
  99. public OnPlayerText(playerid, text[])
  100. {
  101. return 1;
  102. }
  103.  
  104. public OnPlayerCommandText(playerid, cmdtext[])
  105. {
  106. return 0;
  107. }
  108.  
  109. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  110. {
  111. return 1;
  112. }
  113.  
  114. public OnPlayerExitVehicle(playerid, vehicleid)
  115. {
  116. return 1;
  117. }
  118.  
  119. public OnPlayerStateChange(playerid, newstate, oldstate)
  120. {
  121. return 1;
  122. }
  123.  
  124. public OnPlayerEnterCheckpoint(playerid)
  125. {
  126. return 1;
  127. }
  128.  
  129. public OnPlayerLeaveCheckpoint(playerid)
  130. {
  131. return 1;
  132. }
  133.  
  134. public OnPlayerEnterRaceCheckpoint(playerid)
  135. {
  136. return 1;
  137. }
  138.  
  139. public OnPlayerLeaveRaceCheckpoint(playerid)
  140. {
  141. return 1;
  142. }
  143.  
  144. public OnRconCommand(cmd[])
  145. {
  146. return 1;
  147. }
  148.  
  149. public OnPlayerRequestSpawn(playerid)
  150. {
  151. return 1;
  152. }
  153.  
  154. public OnObjectMoved(objectid)
  155. {
  156. return 1;
  157. }
  158.  
  159. public OnPlayerObjectMoved(playerid, objectid)
  160. {
  161. return 1;
  162. }
  163.  
  164. public OnPlayerPickUpPickup(playerid, pickupid)
  165. {
  166. return 1;
  167. }
  168.  
  169. public OnVehicleMod(playerid, vehicleid, componentid)
  170. {
  171. return 1;
  172. }
  173.  
  174. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  175. {
  176. return 1;
  177. }
  178.  
  179. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  180. {
  181. return 1;
  182. }
  183.  
  184. public OnPlayerSelectedMenuRow(playerid, row)
  185. {
  186. return 1;
  187. }
  188.  
  189. public OnPlayerExitedMenu(playerid)
  190. {
  191. return 1;
  192. }
  193.  
  194. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  195. {
  196. return 1;
  197. }
  198.  
  199. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  200. {
  201. return 1;
  202. }
  203.  
  204. public OnRconLoginAttempt(ip[], password[], success)
  205. {
  206. return 1;
  207. }
  208.  
  209. public OnPlayerUpdate(playerid)
  210. {
  211. return 1;
  212. }
  213.  
  214. public OnPlayerStreamIn(playerid, forplayerid)
  215. {
  216. return 1;
  217. }
  218.  
  219. public OnPlayerStreamOut(playerid, forplayerid)
  220. {
  221. return 1;
  222. }
  223.  
  224. public OnVehicleStreamIn(vehicleid, forplayerid)
  225. {
  226. return 1;
  227. }
  228.  
  229. public OnVehicleStreamOut(vehicleid, forplayerid)
  230. {
  231. return 1;
  232. }
  233.  
  234. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  235. {
  236. return 1;
  237. }
  238.  
  239. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  240. {
  241. return 1;
  242. }
  243. stock WaffenSpeichern(playerid)
  244. {
  245. new waffe,ammo,save[40],name[MAX_PLAYER_NAME];
  246. GetPlayerName(playerid,name,sizeof(name));
  247. format(save,sizeof(save),"/Waffen/%s.ini",name);
  248. //____________________________________Waffen Speichern____________________________________
  249. GetPlayerWeaponData(playerid,0,waffe,ammo);
  250. dini_IntSet(save,"waslot",waffe);
  251. dini_IntSet(save,"amslot",ammo);
  252. GetPlayerWeaponData(playerid,1,waffe,ammo);
  253. dini_IntSet(save,"waslot1",waffe);
  254. dini_IntSet(save,"amslot1",ammo);
  255. GetPlayerWeaponData(playerid,2,waffe,ammo);
  256. dini_IntSet(save,"waslot2",waffe);
  257. dini_IntSet(save,"amslot2",ammo);
  258. GetPlayerWeaponData(playerid,3,waffe,ammo);
  259. dini_IntSet(save,"waslot3",waffe);
  260. dini_IntSet(save,"amslot3",ammo);
  261. GetPlayerWeaponData(playerid,4,waffe,ammo);
  262. dini_IntSet(save,"waslot4",waffe);
  263. dini_IntSet(save,"amslot4",ammo);
  264. GetPlayerWeaponData(playerid,5,waffe,ammo);
  265. dini_IntSet(save,"waslot5",waffe);
  266. dini_IntSet(save,"amslot5",ammo);
  267. GetPlayerWeaponData(playerid,6,waffe,ammo);
  268. dini_IntSet(save,"waslot6",waffe);
  269. dini_IntSet(save,"amslot6",ammo);
  270. GetPlayerWeaponData(playerid,7,waffe,ammo);
  271. dini_IntSet(save,"waslot7",waffe);
  272. dini_IntSet(save,"amslot7",ammo);
  273. GetPlayerWeaponData(playerid,8,waffe,ammo);
  274. dini_IntSet(save,"waslot8",waffe);
  275. dini_IntSet(save,"amslot8",ammo);
  276. GetPlayerWeaponData(playerid,9,waffe,ammo);
  277. dini_IntSet(save,"waslot9",waffe);
  278. dini_IntSet(save,"amslot9",ammo);
  279. GetPlayerWeaponData(playerid,10,waffe,ammo);
  280. dini_IntSet(save,"waslot10",waffe);
  281. dini_IntSet(save,"amslot10",ammo);
  282. GetPlayerWeaponData(playerid,11,waffe,ammo);
  283. dini_IntSet(save,"waslot11",waffe);
  284. dini_IntSet(save,"amslot11",ammo);
  285. return 1;
  286. }
  287.  
  288. stock WaffenLaden(playerid)
  289. {
  290. new save[40],name[MAX_PLAYER_NAME];
  291. GetPlayerName(playerid,name,sizeof(name));
  292. format(save,sizeof(save),"/Waffen/%s.ini",name);
  293. //____________________________________Waffen Laden____________________________________
  294. wInfo[playerid][wslot] =dini_Int(save,"waslot");
  295. wInfo[playerid][wslot1] =dini_Int(save,"waslot1");
  296. wInfo[playerid][wslot2] =dini_Int(save,"waslot2");
  297. wInfo[playerid][wslot3] =dini_Int(save,"waslot3");
  298. wInfo[playerid][wslot4] =dini_Int(save,"waslot4");
  299. wInfo[playerid][wslot5] =dini_Int(save,"waslot5");
  300. wInfo[playerid][wslot6] =dini_Int(save,"waslot6");
  301. wInfo[playerid][wslot7] =dini_Int(save,"waslot7");
  302. wInfo[playerid][wslot8] =dini_Int(save,"waslot8");
  303. wInfo[playerid][wslot9] =dini_Int(save,"waslot9");
  304. wInfo[playerid][wslot10] =dini_Int(save,"waslot10");
  305. wInfo[playerid][wslot11] =dini_Int(save,"waslot11");
  306. wInfo[playerid][aslot] =dini_Int(save,"amslot");
  307. wInfo[playerid][aslot1] =dini_Int(save,"amslot1");
  308. wInfo[playerid][aslot2] =dini_Int(save,"amslot2");
  309. wInfo[playerid][aslot3] =dini_Int(save,"amslot3");
  310. wInfo[playerid][aslot4] =dini_Int(save,"amslot4");
  311. wInfo[playerid][aslot5] =dini_Int(save,"amslot5");
  312. wInfo[playerid][aslot6] =dini_Int(save,"amslot6");
  313. wInfo[playerid][aslot7] =dini_Int(save,"amslot7");
  314. wInfo[playerid][aslot8] =dini_Int(save,"amslot8");
  315. wInfo[playerid][aslot9] =dini_Int(save,"amslot9");
  316. wInfo[playerid][aslot10] =dini_Int(save,"amslot10");
  317. wInfo[playerid][aslot11] =dini_Int(save,"amslot11");
  318. return 1;
  319. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement