0 Members and 1 Guest are viewing this topic.
#define CLAN_FILE "/Clans/%s.ini"
if (strcmp(cmd, "clanstats", true) == 0) { tmp = strtok(cmdtext, idx); format(file, sizeof(file), CLAN_FILE, tmp); if(!strlen(tmp)) SendClientMessage(playerid, COLOR_GREEN, "Usage: /c clanstats [clanname]"); else if ( !IsClanRegistered( tmp )) SendClientMessage( playerid, COLOR_RED, " Not Registered ");else{new sz[222];new clanstats;clanstats = dini_Int(file,"Kills");format(sz,222," %s 's ClanStats [ %d ]", tmp, clanstats);SendClientMessageToAll(COLOR_RED,sz );}return 1;}
else if (strcmp(cmd, "regclan", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) SendClientMessage(playerid, COLOR_GREEN, "Usage: /c regclan [clantags]"); else if(IsClanRegistered(tmp)) SendClientMessage(playerid, RED, "Error: already registered!"); else { format(file, sizeof(file), CLAN_FILE, tmp); dini_Create(file); dini_Set(file, "ClanTags", tmp); dini_Set(file, "Kills", "0"); } return 1; }
else if (strcmp(cmd, "addmember", true) == 0) { new plr; new tmp2[132]; tmp = strtok(cmdtext, idx); tmp2 = strtok(cmdtext, idx); plr = FindPlayerIDFromString(tmp); if(!strlen(tmp)) SendClientMessage(playerid, COLOR_GREEN, "Usage: /c addmember [membername] [clantag]"); else if(!IsClanRegistered(tmp2)) SendClientMessage(playerid, RED, "Error: This Clan Is Not Registered!"); else if(!IsPlayerRegistered(gPlayers[plr])) SendClientMessage(playerid,COLOR_RED," This pLayer Is Not Exist "); else { format(file, sizeof(file), CLAN_FILE, tmp2); dini_Set(file, tmp); format(file, sizeof(file), USERS_FILE, plr); dini_Set(file, "Clan", tmp); } return 1; }
Clannn = dini_Int(file, "Clan");
new Clan[MAX_PLAYERS];format(file,sizeof(file), USERS_FILE, gPlayers[killerid]);Clan[killerid] = dini_Int(file,"Clan");ClanStats(Clan[killerid],1);
public ClanStats(clan[],Amount){ format(file, sizeof(file), CLAN_FILE, clan); new cash; cash = dini_Int(file, "Kills"); dini_IntSet(file, "Kills", cash +Amount);}
stock IsClanRegistered(clan[]) { // We need to give the full nick name. format(file, sizeof(file), CLAN_FILE, clan); return (dini_Exists(file)) ? true : false;}
i m a great script Editor
obviously . an admin only because i am still trying to make the define owner of clan systemso i posted as admin permission to register addmembers etc
wat wat wat???