Advertisement
Guest User

d21d12

a guest
Aug 27th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <zombieplague>
  3.  
  4. #define IsComment(%1) (!%1[0]||%1[0]==';'||(%1[0]=='/'&&%1[1]=='/'))
  5.  
  6. new Trie:tAuthIDs;
  7.  
  8. _LoadAuthIDs() {
  9. new iFile = fopen("addons/amxmodx/configs/boostovi.ini","rt");
  10.  
  11. if( iFile )
  12. {
  13. new szAuthID[ 32 ];
  14.  
  15. while( !feof( iFile ) )
  16. {
  17. fgets( iFile, szAuthID, charsmax( szAuthID ) );
  18. trim( szAuthID );
  19.  
  20. if( !IsComment( szAuthID ) )
  21. {
  22. TrieSetCell( tAuthIDs, szAuthID, EOS );
  23. }
  24. }
  25.  
  26. fclose( iFile );
  27. }
  28. }
  29.  
  30. public plugin_init() {
  31. tAuthIDs = TrieCreate();
  32.  
  33. _LoadAuthIDs();
  34. }
  35.  
  36. public client_putinserver(id) {
  37. set_task(15.0,"funcGive",id);
  38. }
  39.  
  40. public funcGive(id) {
  41. if(!is_user_connected(id))
  42. return PLUGIN_HANDLED;
  43.  
  44. static szAuthID[ 32 ];
  45. get_user_authid(id, szAuthID, 31 );
  46.  
  47. if(TrieKeyExists(tAuthIDs, szAuthID)) {
  48. zp_set_user_ammo_packs(id, 5000);
  49. set_hudmessage(255, 0, 0, -1.0, 0.28, 0, 6.0, 12.0)
  50. show_hudmessage(id, "Hvala vam sto ste boostovali server! ^nDobili ste ammo packs!")
  51. }
  52. return PLUGIN_HANDLED;
  53. }
  54.  
  55. public plugin_end() {
  56. TrieDestroy(tAuthIDs);
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement