SA-MP Forums Archive
Forbidden names? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Forbidden names? (/showthread.php?tid=186404)



Forbidden names? - Gh0sT_ - 28.10.2010

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"




Re: Forbidden names? - Cameltoe - 28.10.2010

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.


Re: Forbidden names? - Gh0sT_ - 28.10.2010

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
};


Re: Forbidden names? - PixeledNinja - 28.10.2010

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.


Re: Forbidden names? - Gh0sT_ - 28.10.2010

Oh, my fail. Thanks all. Lock it!


Re: Forbidden names? - Gh0sT_ - 29.10.2010

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