26.04.2018, 07:43
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:
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(playerid, afkdialog, DIALOG_STYLE_INPUT, "{FF0000}Reason:", "{FFFF00}Please Type Reason of going AFK Below.", "Done", "Cancel");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{FF0000}[ERROR]{FFFFFF} You cannot go AFK(Away From Keyboard) with wanted level.");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{FF0000}[ERROR]{FFFFFF} You are already AFK(Away From Keyboard).");
}
return 1;
}