Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: mrockxkingbutt on February 05, 2014, 01:59:35 am

Title: Clanstats , Clan Register [ Working ] By [Me]
Post by: mrockxkingbutt on February 05, 2014, 01:59:35 am
For A Good WOrk Add This

Quote
#define CLAN_FILE     "/Clans/%s.ini"

Add This CMD

Quote
   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

Quote
   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
Quote
      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

Quote
         Clannn = dini_Int(file, "Clan");

OnPlayerDeath

Quote
new Clan[MAX_PLAYERS];
format(file,sizeof(file), USERS_FILE, gPlayers[killerid]);
Clan[killerid] = dini_Int(file,"Clan");
ClanStats(Clan[killerid],1);

Add Public

Quote
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??

Quote
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!











Title: Re: Clanstats , Clan Register [ Working ] By [Me]
Post by: dynavolt71 on February 05, 2014, 10:40:06 am
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" ?
Title: Re: Clanstats , Clan Register [ Working ] By [Me]
Post by: mrockxkingbutt on February 05, 2014, 01:05:24 pm
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
Title: Re: Clanstats , Clan Register [ Working ] By [Me]
Post by: MatheuS on February 05, 2014, 09:42:05 pm
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
Title: Re: Clanstats , Clan Register [ Working ] By [Me]
Post by: mrockxkingbutt on February 05, 2014, 09:54:38 pm
wat wat wat???
Title: Re: Clanstats , Clan Register [ Working ] By [Me]
Post by: MatheuS on February 05, 2014, 10:02:57 pm
wat wat wat???

put clan owner system  :P
Title: Re: Clanstats , Clan Register [ Working ] By [Me]
Post by: mrockxkingbutt on February 05, 2014, 11:12:44 pm
Make Yourself!
or wait while i m trying
so be patient!