Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: mrockxkingbutt on February 05, 2014, 01:59:35 am
-
For A Good WOrk Add This
#define CLAN_FILE "/Clans/%s.ini"
Add This CMD
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;
}
Register CLan
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;
}
Add Members To Clan
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;
}
In Register CMD
Clannn = dini_Int(file, "Clan");
OnPlayerDeath
new Clan[MAX_PLAYERS];
format(file,sizeof(file), USERS_FILE, gPlayers[killerid]);
Clan[killerid] = dini_Int(file,"Clan");
ClanStats(Clan[killerid],1);
Add Public
public ClanStats(clan[],Amount)
{
format(file, sizeof(file), CLAN_FILE, clan);
new cash; cash = dini_Int(file, "Kills");
dini_IntSet(file, "Kills", cash +Amount);
}
Check Is Clan Registered Or Not??
stock IsClanRegistered(clan[]) { // We need to give the full nick name.
format(file, sizeof(file), CLAN_FILE, clan);
return (dini_Exists(file)) ? true : false;
}
If U Liked It Rate My Post And Give Me A Big Thanks!!
Thank You!
-
Should Admin only. WHY ?
Example
If A Is leader of clan 1 Then B is not leader (plus Not of Part clan) of clan 1
then what happen if player B is Type
"/c addmember B 1" ?
-
obviously . an admin only because i am still trying to make
the define owner of clan system
so i posted as admin permission to register addmembers etc
-
obviously . an admin only because i am still trying to make
the define owner of clan system
so i posted as admin permission to register addmembers etc
Post Complete :o
-
wat wat wat???
-
wat wat wat???
put clan owner system :P
-
Make Yourself!
or wait while i m trying
so be patient!