Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #include <foreach>
- #include <streamer>
- #include <sscanf2>
- #include <dini>
- enum dData
- {
- Gangid
- }
- new PlayerInfo[MAX_PLAYERS][dData];
- #define PlayerFile "playergang/%s.ini"
- #define MAX_GANGS 3
- enum gData
- {
- Ganggp
- }
- new GangInfo[gData];
- #define GangsFile "Gangsgp.ini"
- #define COLOR_RED 0xFF0000FF
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new file[256], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- format(file,sizeof(file),PlayerFile,name);
- if(!dini_Exists(file) )
- {
- dini_Create(file);
- dini_Set(file,"Name",name);
- dini_IntSet(file,"Gangid",0);
- PlayerInfo[playerid][Gangid] = 0;
- }
- else
- {
- PlayerInfo[playerid][Gangid] = dini_Int(file,"Gangid");
- new file2[256];
- format(file2,sizeof(file2),GangsFile);
- GangInfo[gData] = dini_Int(file2,"Ganggp");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new file[256], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- format(file,sizeof(file),PlayerFile,name);
- if(dini_Exists(file) )
- {
- dini_IntSet(file,"Gangid",PlayerInfo[playerid][Gangid]);
- }
- return 1;
- }
- CMD:setgangid(playerid,params[])
- {
- new id, level;
- if(sscanf(params,"ud",id,level) ) return SendClientMessage(playerid,COLOR_RED,"USUAGE: /setgangid [id][gangid]");
- if(!IsPlayerAdmin(playerid) ) return SendClientMessage(playerid,COLOR_RED,"You are not an admin!");
- if(level > MAX_GANGS) return SendClientMessage(playerid,COLOR_RED,"Invalid Level");
- if(!IsPlayerConnected(id) ) return SendClientMessage(playerid,COLOR_RED,"Player is not connected");
- else
- {
- PlayerInfo[id][Gangid] = level;
- SpawnPlayer(id);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement