Help in AFK System
#2

You are trying to use playerid outside of all callbacks, functions, etc. It is not defined there.
After that you are trying to use playerid as an array, which it is not.

Place GetPlayerWantedLevel inside of the function and then instead of using playerid[..] just get the wanted level, no point in saving the data as you don't use it anywhere else.
Also, GetPlayerWantedLevel(playerid) should be equal to 0 since you want the player not to have a wanted level, currently you are doing the opposite.

Like this:
PHP код:
#define afkdialog 1165
new afk[MAX_PLAYERS];
new 
Text3D:label[MAX_PLAYERS];
CMD:afk(playerid,params[])
{
    if(
afk[playerid] == 0)
    {
       if(
GetPlayerWantedLevel(playerid) == 0)
       {
         
ShowPlayerDialog(playeridafkdialogDIALOG_STYLE_INPUT"{FF0000}Reason:""{FFFF00}Please Type Reason of going AFK Below.""Done""Cancel");
       }
       else
       {
          
SendClientMessage(playeridCOLOR_WHITE"{FF0000}[ERROR]{FFFFFF} You cannot go AFK(Away From Keyboard) with wanted level.");
       }
     else
     {
         
SendClientMessage(playeridCOLOR_WHITE"{FF0000}[ERROR]{FFFFFF} You are already AFK(Away From Keyboard).");
     }
     return 
1;

Reply


Messages In This Thread
Help in AFK System - by LegendAbdullah - 26.04.2018, 07:27
Re: Help in AFK System - by AdamsLT - 26.04.2018, 07:43
Re: Help in AFK System - by LegendAbdullah - 26.04.2018, 07:49
Re: Help in AFK System - by LegendAbdullah - 26.04.2018, 07:54
Re: Help in AFK System - by AdamsLT - 26.04.2018, 08:02
Re: Help in AFK System - by LegendAbdullah - 26.04.2018, 08:56
Re: Help in AFK System - by CodeStyle175 - 26.04.2018, 09:15
Re: Help in AFK System - by LegendAbdullah - 26.04.2018, 09:36
Re: Help in AFK System - by Stev - 26.04.2018, 10:04
Re: Help in AFK System - by UFF - 26.04.2018, 10:18

Forum Jump:


Users browsing this thread: 1 Guest(s)