Author Topic: Clanstats , Clan Register [ Working ] By [Me]  (Read 4402 times)

0 Members and 1 Guest are viewing this topic.

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Clanstats , Clan Register [ Working ] By [Me]
« 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!











My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline dynavolt71

  • Crime Boss
  • ****
  • Posts: 371
    • View Profile
    • My Blog
Re: Clanstats , Clan Register [ Working ] By [Me]
« Reply #1 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" ?
[PAWNO]Fix Error " Failed to set data for "" " - http://forum.vicecitymultiplayer.com/index.php?topic=5743.0



:'(

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: Clanstats , Clan Register [ Working ] By [Me]
« Reply #2 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
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline MatheuS

  • Made Man
  • ***
  • Posts: 207
  • Pawn And Squirrel Scripter
    • View Profile
    • Brazillian Community
Re: Clanstats , Clan Register [ Working ] By [Me]
« Reply #3 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

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: Clanstats , Clan Register [ Working ] By [Me]
« Reply #4 on: February 05, 2014, 09:54:38 pm »
wat wat wat???
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline MatheuS

  • Made Man
  • ***
  • Posts: 207
  • Pawn And Squirrel Scripter
    • View Profile
    • Brazillian Community
Re: Clanstats , Clan Register [ Working ] By [Me]
« Reply #5 on: February 05, 2014, 10:02:57 pm »

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: Clanstats , Clan Register [ Working ] By [Me]
« Reply #6 on: February 05, 2014, 11:12:44 pm »
Make Yourself!
or wait while i m trying
so be patient!
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol