SA-MP Forums Archive
How to create ? Help please - 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)
+--- Thread: How to create ? Help please (/showthread.php?tid=549496)



How to create ? Help please - Shinta307 - 07.12.2014

I want to make this for a player that can not use the nickname [ADMINISTRATOR]
pawn Код:
if (strfind (playername, "_", true) == -1)
{
SendClientMessageEx (playerid, COLOR_LIGHTBLUE, "Connection refused. Enter the name in the correct format Example: Joko_Widodo");
}
if (strfind (playername, "[ADMINISTRATOR]", true) == -1)
{
SendClientMessageEx (playerid, COLOR_LIGHTBLUE, "Connection refused. Because you are not admin!");
}
is this true?
sorry for my bad english


Re: How to create ? Help please - DrumYum - 07.12.2014

https://sampwiki.blast.hk/wiki/Strfind
Function returns -1 when it's not found.

You need something like that, maybe:
Код:
if(strfind(playername, "[ADMINISTRATOR]", true) != -1)
{
    SendClientMessage(playerid, -1, "Connection refused. Because you are not admin!");
}



Re: How to create ? Help please - ATGOggy - 07.12.2014

Use this:
PHP код:
if(strcmp(playername"[ADMINISTRATOR], true,15)==0)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "
Connection refusedBecause you are not admin!");
}
if(strcmp(playername, "
_", true,1)==0)
{
SendClientMessage (playerid, COLOR_LIGHTBLUE, "
Connection refusedEnter the name in the correct format ExampleJoko_Widodo");




Re: How to create ? Help please - Shinta307 - 07.12.2014

no , i wont to create if player login use nick [ADMINISTRATOR] in nick , he could no entry except admin


Re: How to create ? Help please - Shinta307 - 07.12.2014

Is this use ?
pawn Код:
if (PlayerInfo[playerid][pAdmin] >= 1)



Re: How to create ? Help please - ATGOggy - 07.12.2014

yes, it is


Re: How to create ? Help please - Shinta307 - 07.12.2014

No, I can not make the script, so every player who register using the nick [ADMINISTRATOR] He will come out (except admin)