Tag problem
#1

I don't have any errors/warnings, I have some problem, I changed my name to [KZ] clan tag, but when i quit and i join I am kicked.

pawn Код:
new stringtag[128]; //if the name contains [KZ] tag...
    if (PlayerInfo[playerid][pTag] == 0)
    {
    if(strfind(Name(playerid), "[KZ]", true) != -1)
    {
        {
            format(stringtag, sizeof(stringtag), "%s has been kicked from the Server [Reason: Unauthorized Tag]", Name(playerid));
            SendClientMessageToAll(C_LBLUE, stringtag);
            DelayKick(playerid, 100);
        }
    }
    }
please guide me to fix the problem, thanks in advace.
Reply
#2

pawn Код:
new name[24]; // Makes a new string for the name
    GetPlayerName(playerid,name,sizeof(name)); // Assigns it to the name
    if(strfind(name,"[KZ]",true) != -1) // The != is if it was found.
    {
    if (PlayerInfo[playerid][pTag] != 1)
    {
      SendClientMessage(playerid, COLOR_LIGHTRED, "** You are not in [KG] clan. Result is kick from the server **");
      Kick(playerid);
      return 1;
    }
    }
Reply
#3

Quote:
Originally Posted by IceBilizard
Посмотреть сообщение
pawn Код:
new name[24]; // Makes a new string for the name
    GetPlayerName(playerid,name,sizeof(name)); // Assigns it to the name
    if(strfind(name,"[KZ]",true) != -1) // The != is if it was found.
    {
      SendClientMessage(playerid, COLOR_LIGHTRED, "** You are not in [KG] clan. Result is kick from the server **");
    Kick(playerid);
    return 1;
    }
    }
but i am in KZ clan dude, and see in,
pawn Код:
if (PlayerInfo[playerid][pTag] == 0)
if the value is 0 only it kicks, but my stats is in database is Tag = 1
Reply
#4

added

pawn Код:
if (PlayerInfo[playerid][pTag] != 1)// must have 1
Reply
#5

does'nt work ice.
Reply
#6

Where you using this code?
use this code under onplayerspawn i am using this working perfect
Reply
#7

no i place it on OnPlayerConnect.
Reply
#8

Strfind returns -1 when the needle (the word searched) is NOT found. In this case, you inverted the checks.

pawn Код:
new stringtag[128];

if(PlayerInfo[playerid][pTag] == 0) // The server found the player is not part of the clan. Has they got the tag into their name?
{
    if(strfind(Name(playerid), "[KZ]", true) > -1) // If the server does not find the tag, strfind returns -1. That means the following code is not executed.
    {
        format(stringtag, sizeof(stringtag), "%s has been kicked from the Server [Reason: Unauthorized Tag]", Name(playerid));
        SendClientMessageToAll(C_LBLUE, stringtag);
        DelayKick(playerid, 100);
    }
}
Reply
#9

Quote:
Originally Posted by DetoNater
Посмотреть сообщение
no i place it on OnPlayerConnect.
Place under Onplayerspawn
Reply
#10

Quote:
Originally Posted by GiamPy.
Посмотреть сообщение
Strfind returns -1 when the needle (the word searched) is NOT found. In this case, you inverted the checks.

pawn Код:
new stringtag[128];

if(PlayerInfo[playerid][pTag] == 0) // The server found the player is not part of the clan. Has they got the tag into their name?
{
    if(strfind(Name(playerid), "[KZ]", true) > -1) // If the server does not find the tag, strfind returns -1. That means the following code is not executed.
    {
        format(stringtag, sizeof(stringtag), "%s has been kicked from the Server [Reason: Unauthorized Tag]", Name(playerid));
        SendClientMessageToAll(C_LBLUE, stringtag);
        DelayKick(playerid, 100);
    }
}
sorry dude, dint work. by the way,
pawn Код:
if(PlayerInfo[playerid][pTag] == 0)//the player is not in the clan!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)