bug rp name kick
#1

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.

Reply
#2

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

Код:
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));
Reply
#4

Thank you BulletRaja
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)