Errors.......
#1

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

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;
}
NOTE: this code won't work like it is
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
Reply
#3

Quote:
Originally Posted by Sascha
Посмотреть сообщение
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;
}
NOTE: this code won't work like it is
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[])
Reply
#4

BUMP ...
- sry spam... But i need this...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)