07.02.2016, 12:35
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:
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
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