11.03.2012, 21:55
Ill give you the one i used to use before i started linking with MySQL, just change the command of Clan accordingly:
Top of your code:
Clan Command
Stocks goes anywhere in your code
Also if you want a SetClan Member command for rcon admin:
Hope this helps, change it accordingly
Top of your code:
Код:
enum PlayerData{ InClan };
Код:
CMD:c(playerid, params[]) { format(userfile, 256, "/CLAN/%s.ini", GetName(playerid)); PlayerInfo[playerid][InClan] = dini_Int(userfile, "InClan"); if(PlayerInfo[playerid][InClan] < 1) return false; if(!strlen(params)) return SendClientMessage(playerid,RED,"Usage: /c [text]"); new name[24],string[256]; GetPlayerName(playerid,name,sizeof(name)); format(string,sizeof(string),"Clan Chat: %s (ID: %d): %s",name,playerid,params); SendClanMsg(LIGHTBLUE, string); return 1; }
Код:
stock SendClanMsg(color,string[]){ for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) == 1 && PlayerInfo[i][InClan] > 0) { SendClientMessage(i, color, string); } } return 1; }
Код:
CMD:setclanmember(playerid, params[]) { new player1, string[128], string2[128]; sscanf(params,"d",player1); if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "You must be RCON admin to set people to the clan!"); if(sscanf(params,"u",player1)) return SendClientMessage(playerid,RED,"Usage: /setclanmember [PlayerID/PartOfName]"); format(userfile, 128, "/CLAN/%s.ini", GetName(player1)); if(dini_Int(userfile, "InClan")==1) return SendClientMessage(playerid,RED,"That player is already in a clan!"); if(!IsPlayerConnected(player1) || player1 == INVALID_PLAYER_ID) return SendClientMessage(playerid,RED,"Invalid ID"); format(string, sizeof(string), "You are now in the clan!"); format(string2, sizeof(string2), "%s (ID: %d) is now in the clan!", GetName(player1), player1); if(!dini_Exists(userfile)) { SendClientMessage(player1, GREEN, string); SendClientMessage(playerid, GREEN, string2); dini_Create(userfile); dini_IntSet(userfile, "InClan",1); } return 1; }