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