Forbidden names?
#1

Quote:

new NegalimiVardai[][] =
{
"Byby_Uostyk", "Kurva_Botas", "Dalbajobas_Nachui", "Bybis_Bybis", "Pagr_Admin", "Ciulpk_Byby", "Ciulpk_Desra", "Kancelink_Desra", "Naxui_Botas"
};

at top of script..
than..
Quote:

new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < sizeof(NegalimiVardai); i ++ )
{
if(!strcmp(name, NegalimiVardai, true))
{
SendClientMessage(playerid, 0xFF0000FF, "Praneрimas: Vardas, kurб Jыs esate uюsidлjж NЛRA leidюiamas.");
SendClientMessage(playerid, 0xFF0000FF, "Praрome pasikeisti savo vardа б tikroviрkа.");
Kick(playerid);
}
}

and i get error:
Quote:

error 035: argument type mismatch (argument 2)

Quote:

symbol is never used: "NegalimiVardai"

Reply
#2

pawn Код:
new IllegalNames[] = {
    "Yoyo_yoyo","Test_Admin"
};

public OnPlayerConnect(playerid)
{
    for(new i; i < sizeof(IllegalNames); i ++ )
    {
        if(strmatch(GetName(playerid), IllegalNames[i]))
        {
             // do shiiit.
        }
    }
}

stock GetName(playerid)
{
    new pName[24];
    GetPlayerName(playerid, pName, 24);
    return pName;
}

stock strmatch(const String1[], const String2[])
{
    if ((strcmp(String1, String2, true, strlen(String2)) == 0) && (strlen(String2) == strlen(String1)))
    {
        return true;
    }
    else
    {
        return false;
    }
}
Pretty sure it should work.
Reply
#3

Thanks, but.
Quote:

new NeleistiniVardai[][] = {
{
"Byby_Uostyk", "Kurva_Botas", "Dalbajobas_Nachui", "Bybis_Bybis", "Pagr_Admin", "Ciulpk_Byby", "Ciulpk_Desra", "Kancelink_Desra", "Naxui_Botas"
};

error 001: expected token: "}", but found ";"
error at
};
Reply
#4

Quote:
Originally Posted by Gh0sT_
Посмотреть сообщение
Thanks, but.

error 001: expected token: "}", but found ";"
error at
};
You have 2 opening brackets but only one closing bracket.
Reply
#5

Oh, my fail. Thanks all. Lock it!
Reply
#6

Nvm, srry for that.
Is that possible, to check if player pressed f4?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)