Clan Tag Name
#1

hey so I'm trying to make a clan system using dini but it isn't work when I join game with the tag it kick me as I ut wanted and when I set player clan member it should save his acc but it didn't and when he connect it should create it and load it here is the code:
PHP код:
#include <Dini>
#include <dudb>
#define NewPath "Accounts/%s.ini"
public OnPlayerConnect(playerid)
{
     new 
isname[MAX_PLAYER_NAME], file[256];
    
GetPlayerName(playeridisnamesizeof(isname));
    
format(filesizeof(file), NewPathisname);
    if (!
dini_Exists(file))
    {
        new 
name[MAX_PLAYER_NAME], file[256], string[128];
        
GetPlayerName(playeridnamesizeof(name));
        
format(filesizeof(file), NewPathname);
        
dini_Create(file);
        
dini_IntSet(file"ClanMember",PlayerInfo[playerid][pClan] = 0);
        
//format(string, 128, "[SYSTEM]: you have registered with the name %s with password %s.", name, inputtext);
        //SendClientMessage(playerid, COLOR_YELLOW, string);
    
}
    if(
fexist(file))
    {
        new 
name[MAX_PLAYER_NAME], file[256];
        
GetPlayerName(playeridnamesizeof(name));
        
format(filesizeof(file), NewPathname);
        
PlayerInfo[playerid][pClan] = dini_Int(file"ClanMember");
    }
    new 
clanname[24]; // Makes a new string for the name
    
GetPlayerName(playerid,clanname,sizeof(clanname)); // Assigns it to the name
    
if(strfind(clanname,"[uLg]",true) != -1// The != is if it was found.
    
{
        if(
PlayerInfo[playerid][pClan] >= 1// In this case the clan they need to be in is 1
          
{
            
// If they are not in the clan then it kicks them.
            
SendClientMessage(playeridCOLOR_RED"** Welcome to clan [uLg] **");
             return 
1;
          }
          else
          {
            
// If they are then send them a nice welcome message. :)
               
SendClientMessage(playeridCOLOR_RED"** You are not in [uLg] clan. Change Your Name Now **");
            
SetTimerEx("KickClan"2000false"i"playerid);
          }
    }
return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
     new 
isname[MAX_PLAYER_NAME], file[256];
    
GetPlayerName(playeridisnamesizeof(isname));
    
format(filesizeof(file), NewPathisname);
    
dini_IntSet(file"ClanMember",PlayerInfo[playerid][pClan]);
return 
1;
}
forward KickClan(playerid);
public 
KickClan(playerid)
{
    
Kick(playerid);
    return 
1;
}
CMD:setclanmember(playeridparams[])
{
    if(
adlvl[playerid] >= 6)
    {
        new 
nom MAX_PLAYER_NAME ] , str 200 ] , pidoption[128];
        if(
sscanf(params"us"pidoption))
        {
            
SendClientMessage(playeridCOLOR_YELLOW"{FFFFFF} /setclanmember [ID] [option]");
            
SendClientMessage(playeridCOLOR_YELLOW"{FFFFFF} Options:[0=remove][1=set].");
            return 
1;
        }
        if (
strcmp(option"0"true) == 0)
          {
            
GetPlayerName playerid nom sizeof nom ) ) ;
            
GetPlayerName pid nom sizeof nom ) ) ;
            
format str sizeof str ) , "*You Have Kicked %s From clan member list" nom ) ;
            
SendClientMessage playerid 0x00FF00AA str ) ;
            
format str sizeof str ) , "*Admin %s Has Kick You From [uLg] Clan! Now Remove your [uLg] Tag!" nom ) ;
            
SendClientMessage playerid 0x00FF00AA str ) ;
            
PlayerInfo[playerid][pClan] = ;
            new 
isname[MAX_PLAYER_NAME], file[256];
            
GetPlayerName(playeridisnamesizeof(isname));
            
format(filesizeof(file), NewPathisname);
            
dini_IntSet(file"ClanMember",PlayerInfo[playerid][pClan]);
          }
           if (
strcmp(option"1"true) == 0)
         {
            
GetPlayerName playerid nom sizeof nom ) ) ;
            
GetPlayerName pid nom sizeof nom ) ) ;
            
format str sizeof str ) , "*You Have Successfuly Set %s As An Clan Member!" nom ) ;
            
SendClientMessage playerid 0x00FF00AA str ) ;
            
format str sizeof str ) , "*%s Has Made You A [uLg] Clan Member! Now You Are Allowed To Use [uLg] Tag in Your Name!" nom ) ;
            
SendClientMessage playerid 0x00FF00AA str ) ;
            
PlayerInfo[playerid][pClan] = ;
            
strins(nom,"[uLg]",0,sizeof(nom));
            
SetPlayerName(pid,nom);
            new 
isname[MAX_PLAYER_NAME], file[256];
            
GetPlayerName(playeridisnamesizeof(isname));
            
format(filesizeof(file), NewPathisname);
            
dini_IntSet(file"ClanMember",PlayerInfo[playerid][pClan]);
          }
    }
     else return 
0;
    return 
1;

thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)