jb kicker?
#1

ok.. just read this then read the errors then fix it and reply!!!
pawn Код:
if(strcmp(pname, "justin bieber", false, 128));
{
     Kick(playerid);
     return 1;
}
pawn Код:
C:\Documents and Settings\Matt\Desktop\party time\gamemodes\PARTY.pwn(127) : error 036: empty statement
C:\Documents and Settings\Matt\Desktop\party time\gamemodes\PARTY.pwn(133) : warning 225: unreachable code
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
HMMM... What to do
Reply
#2

pawn Код:
if(!strcmp(pname, "justin bieber", true));
{
     Kick(playerid);
     return 1;
}
Remove the 128? And strcmp returns 0 when they match.
Reply
#3

pawn Код:
if(!strcmp(pname, "justin bieber", true));
    {
        Kick(playerid);
        return 0;
    }
same errors....
Reply
#4

maybe your doing it wrong.. try this?

Код:
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname);
if(!strcmp(pname, "justin bieber", true))
    {
        Kick(playerid);
        return 0;
    }
Reply
#5

omfg were dumb... we had to remove the ; on:
if(!strcmp(pname, "justin bieber", true));
wooooooooooooooooooooooooooow!!!!!!!!!!!!!!!!
Reply
#6

So how is it?
Can you post the whole script so I can see it pls.
Reply
#7

pawn Код:
public OnPlayerConnect(playerid)
{
    new pname[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));

    if(!strcmp(pname, "justin bieber", true))
    {
        Kick(playerid);
        return 0;
    }

    if(strlen(pname) > 12) // Will kick the player if his name is longer than 12 characters.
    {
        SendClientMessage(playerid, COLOR_RED, "Your name is too long, It must be 12 or less characters.");
        Kick(playerid);
        return 0;
    }

    SendClientMessage(playerid, COLOR_GREEN, "PLEASE USE /help FOR SOME SERVER INFO AND COMMANDS");
    UsePlayerPedAnims();
    UpdateTimeForAll();
    format(str, sizeof(str), USERFILE, pname);
    new ip[24];
    GetPlayerIp(playerid, ip, sizeof(ip));
    if(!fexist(str))
    {
        djAutocommit(false);
        djCreateFile (str);
        djSet(str,"player/NAME", pname);
        djSetInt(str,"player/SCORE",GetPlayerScore(playerid));
        djSetInt(str,"player/CASH",GetPlayerMoney(playerid));
        djSet(str,"player/IP", ip);
        djCommit(str);
        djAutocommit(true);
    }
    else
    {
        if(!strcmp(ip, dj(str, "player/IP")))
        {
            SetPlayerScore(playerid, djInt(str, "player/SCORE"));
            ResetPlayerMoney(playerid);
            GivePlayerMoney(playerid, djInt(str, "player/CASH"));
        }
        else
        {
            new string[128];
            format(string, sizeof(string), "YOU ARENT THE REAL %s!! GTFO!", pname);
            SendClientMessage(playerid, COLOR_RED, string);
            Kick(playerid);
            return 0;
        }
    }
    return 1;
}
dont work.. but i dont care. No errors... maybe its since i have this : #undef MAX_PLAYER_NAME and #define MAX_PLAYER_NAME 12 because of djson .... if the name is too large... it wont save the .json thing... anyway.. ya.
Reply
#8

Well it's only going to kick him if his name is exactly 'justin bieber'. You could search the name for the words 'justin' and 'bieber'.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)