SA-MP Forums Archive
bug rp name kick - 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: bug rp name kick (/showthread.php?tid=650498)



bug rp name kick - wenx - 01.03.2018

bug rp name kick

Quote:

public OnPlayerConnect(playerid)
{
if(strfind(name, "_", true) != -1)
{
new string[150],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name, sizeof(name));
format(string,sizeof(string),"AdmCmd: %s has been auto kicked [reason: Get a roleplay name ex: John_Smith]",name);
SendClientMessageToAll(-1,string);
Kick(playerid);
}
return 1;
}

Quote:

C:\Users\Familia\Desktop\samp03DL_svr_R1_win32\fil terscripts\admins.pwn(18 : error 017: undefined symbol "name"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.




Re: bug rp name kick - X337 - 01.03.2018

name variable is not defined.
You should get the player name first before checking it.


Re: bug rp name kick - BulletRaja - 01.03.2018

Код:
public OnPlayerConnect(playerid)
{
new name[25];
GetPlayerName(playerid, name, sizeof(name));
if(strfind(name, "_", true) != -1)
{
new string[150],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name, sizeof(name));
format(string,sizeof(string),"AdmCmd: %s has been auto kicked [reason: Get a roleplay name ex: John_Smith]",name);
SendClientMessageToAll(-1,string);
Kick(playerid);
}
return 1;
}
Код:
to get player name add this on player connect
new name[25];
GetPlayerName(playerid, name, sizeof(name));



Re: bug rp name kick - wenx - 01.03.2018

Thank you BulletRaja