(58694) error 012: invalid function call, not a valid address (58694) warning 215: expression has no effect (58694) error 001: expected token: ";", but found ")" (58694) error 029: invalid expression, assumed zero (58694) fatal error 107: too many error messages on one line
new OnPlayerOfflineLogin;
new name;
OnPlayerOfflineLogin(name);
if( PlayerInfo[MAX_PLAYERS][pPermaBanned] == 3 || PlayerInfo[MAX_PLAYERS][pBanned] >= 1 )
{
SendClientMessage( playerid, COLOR_WHITE, "That player is banned" );
return 1;
}
OnPlayerOfflineLogin(name);
forward OnPlayerOfflineLogin(name[]);
public OnPlayerOfflineLogin(name[])
{
if( PlayerInfo[MAX_PLAYERS][pPermaBanned] == 3 || PlayerInfo[MAX_PLAYERS][pBanned] >= 1 )
{
SendClientMessage( playerid, COLOR_WHITE, "That player is banned" );
}
return 1;
}
|
You are creating a variable and trying to use it as a callback.
If you want to create custom callbacks, you'll have to forward and not initialize them you shall do it like this: Код:
forward OnPlayerOfflineLogin(name[]);
public OnPlayerOfflineLogin(name[])
{
if( PlayerInfo[MAX_PLAYERS][pPermaBanned] == 3 || PlayerInfo[MAX_PLAYERS][pBanned] >= 1 )
{
SendClientMessage( playerid, COLOR_WHITE, "That player is banned" );
}
return 1;
}
You can not use "PlayerInfo[MAX_PLAYERS]..." the way you are using, you have to enter the ID you want to check not "max_players", cause that would be the number you've set to maximum players on your server. It either has to be "PlayerInfo[playerid]" or you need to get the playerid of the "name" entered when calling the callback |
(58723) : warning 219: local variable "OnPlayerOfflineLogin" shadows a variable at a preceding level (58724) : error 029: invalid expression, assumed zero (58724) : error 012: invalid function call, not a valid address (58724) : error 029: invalid expression, assumed zero (58724) : fatal error 107: too many error messages on one line
if(fexist(string))
{
new OnPlayerOfflineLogin;
public OnPlayerOfflineLogin(name[])
{
if( PlayerInfo[MAX_PLAYERS][pPermaBanned] == 3 || PlayerInfo[MAX_PLAYERS][pBanned] >= 1 )
{
SendClientMessage( playerid, COLOR_WHITE, "That player is banned" );
}
return 1;
}
}
else
public OnPlayerOfflineLogin(name[])