Author Topic: Easy Clan-war System By me and aledark24 :)  (Read 3796 times)

0 Members and 1 Guest are viewing this topic.

Offline Tomiijaja

  • Street Thug
  • *
  • Posts: 24
    • View Profile
Easy Clan-war System By me and aledark24 :)
« on: April 12, 2013, 05:17:13 am »
Hello all, today i bring a Easy clan-war make by aledark24 and me.. XD, Ok First:

Create a public:

[pawn]public LevelClans(Clan)
{
   new clan[256];
    if (Clan == 0) clan = "Clan0";
   if (Clan == 1) clan = "Clan1";
    if (Clan == 2) clan = "Clan2";
   if (Clan == 3) clan = "Clan3";
   if (Clan == 4) clan = "Clan4";
   if (Clan == 5) clan = "Clan5";
   if (Clan == 6) clan = "Clan6";
   if (Clan == 7) clan = "Clan7";
    if (Clan == 8) clan = "Clan8";
    if (Clan == 9) clan = "Clan9";
   if (Clan == 10) clan = "Clan10";
   if (Clan == 11) clan = "Clan11";
   else if (Clan >= 12) clan = "Clan12";
   return clan;
}
[/pawn]
Place this Dini_set in your /c register Command, to modify a clan without stay In-Game (with the Users File):

[pawn]   dini_Set( file, "Clan", "1" );[/pawn]

Create 2 Publics:

[pawn]public GetPlayerClan(playerid)
{
    format(INFO,256, USERS_FILE, gPlayers[playerid]);
   new Clan; Clan = dini_Int(INFO,"Clan");
   return Clan;
}
public SetPlayerClan(playerid,Clan)
{
    format(INFO,256, USERS_FILE, gPlayers[playerid]);
   dini_IntSet(INFO,"Clan",Clan);
}[/pawn]

Create a command for admins, to register a user in a clan:

[pawn]            else if (strcmp(cmd, "setclan", true) == 0)
     {
     new level[256];
     new plr;
      tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp), level = strtok(cmdtext, idx);
   if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please Login your account" );
else  if (!strlen(tmp)) Mensaje(playerid, RED,"[System] - Use: /c setclan <Nick/ID> <IDClan>" );
else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You need required a admin level to use this command" );
    else if (plr == INACTIVE_PLAYER_ID) Mensaje(playerid, ROJO,"[Error] - Player Not Connected");
           else {
      {
               format( szMsg, sizeof( szMsg ), "Admin %s register %s in the clan [%s]",gPlayers[playerid],gPlayers[plr],LevelClans(strval(level)));
            SendClientMessageToAll( COLOR_GREEN, szMsg);
                SetPlayerClan(plr,strval(level));
              }
      }
      return 1;
    }
[/pawn]

Macro:

[pawn]#define Mensaje SendClientMessage[/pawn]

The Basic commands for users...:

[pawn]            else if (strcmp(cmd, "accepttest", true) == 0)
     {
      tmp = strtok(cmdtext, idx);
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please Login." );
           else {
       if(GetPlayerClan(playerid) == 0)
      {
     SetPlayerPos(playerid,-1766.81921,-137.94221,14.86832, 0, 0);
             format( szMsg, sizeof( szMsg ), "%s Accepted the Clanwar [TEST]",gPlayers[playerid]);
            SendClientMessageToAll( AMARILLO, szMsg);
              }
else SendClientMessage(playerid,COLOR_RED,"You no are a member of ClanTest or admin not registered you in a clan");
     }
      return 1;
}[/pawn]

To members using Commands for Only Clan, Create a commands with "GetPlayerClans"... This command is a test.. basic :)

Credits: 52% By Aledark24

And, Sorry for my bad english.
« Last Edit: April 12, 2013, 05:23:29 am by Tomiijaja »

Offline aledark24

  • Made Man
  • ***
  • Posts: 206
  • I am a scripter and you have celous of me....so you crashed my servers
    • View Profile
Re: Easy Clan-war System By me and aledark24 :)
« Reply #1 on: April 12, 2013, 03:30:35 pm »
xD
i see my 52 %
but not  find credits for this
I am a great scripter and you are celous of my works
.....

Vice City Life Multiplayer By Saint

Offline Fire_Head

  • Street Thug
  • *
  • Posts: 35
    • View Profile
Re: Easy Clan-war System By me and aledark24 :)
« Reply #2 on: April 13, 2013, 07:46:45 pm »
Not Bad :)