Advertisement
Blackevils

Untitled

Apr 26th, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. #define FILTERSCRIPT
  2. #include <a_samp>
  3. #include <zcmd>
  4. #include <foreach>
  5. #include <streamer>
  6. #include <sscanf2>
  7. #include <dini>
  8.  
  9. enum dData
  10. {
  11. Gangid
  12. }
  13. new PlayerInfo[MAX_PLAYERS][dData];
  14. #define PlayerFile "playergang/%s.ini"
  15. #define MAX_GANGS 3
  16.  
  17. enum gData
  18. {
  19. Ganggp
  20. }
  21. new GangInfo[gData];
  22. #define GangsFile "Gangsgp.ini"
  23.  
  24. #define COLOR_RED 0xFF0000FF
  25.  
  26. public OnFilterScriptInit()
  27. {
  28. print("\n--------------------------------------");
  29. print(" Blank Filterscript by your name here");
  30. print("--------------------------------------\n");
  31. return 1;
  32. }
  33.  
  34. public OnFilterScriptExit()
  35. {
  36. return 1;
  37. }
  38.  
  39. public OnPlayerConnect(playerid)
  40. {
  41. new file[256], name[MAX_PLAYER_NAME];
  42. GetPlayerName(playerid,name,sizeof(name));
  43. format(file,sizeof(file),PlayerFile,name);
  44. if(!dini_Exists(file) )
  45. {
  46. dini_Create(file);
  47. dini_Set(file,"Name",name);
  48. dini_IntSet(file,"Gangid",0);
  49. PlayerInfo[playerid][Gangid] = 0;
  50. }
  51. else
  52. {
  53. PlayerInfo[playerid][Gangid] = dini_Int(file,"Gangid");
  54.  
  55. new file2[256];
  56. format(file2,sizeof(file2),GangsFile);
  57. GangInfo[gData] = dini_Int(file2,"Ganggp");
  58. }
  59. return 1;
  60. }
  61.  
  62. public OnPlayerDisconnect(playerid, reason)
  63. {
  64. new file[256], name[MAX_PLAYER_NAME];
  65. GetPlayerName(playerid,name,sizeof(name));
  66. format(file,sizeof(file),PlayerFile,name);
  67. if(dini_Exists(file) )
  68. {
  69. dini_IntSet(file,"Gangid",PlayerInfo[playerid][Gangid]);
  70. }
  71. return 1;
  72. }
  73.  
  74. CMD:setgangid(playerid,params[])
  75. {
  76. new id, level;
  77. if(sscanf(params,"ud",id,level) ) return SendClientMessage(playerid,COLOR_RED,"USUAGE: /setgangid [id][gangid]");
  78. if(!IsPlayerAdmin(playerid) ) return SendClientMessage(playerid,COLOR_RED,"You are not an admin!");
  79. if(level > MAX_GANGS) return SendClientMessage(playerid,COLOR_RED,"Invalid Level");
  80. if(!IsPlayerConnected(id) ) return SendClientMessage(playerid,COLOR_RED,"Player is not connected");
  81. else
  82. {
  83. PlayerInfo[id][Gangid] = level;
  84. SpawnPlayer(id);
  85. }
  86. return 1;
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement