(17358) : error 029: invalid expression, assumed zero (17358) : warning 215: expression has no effect (17358) : error 001: expected token: ";", but found ")" (17358) : error 029: invalid expression, assumed zero (17358) : fatal error 107: too many error messages on one line
PlayerAfkTicks[i] ++; } else { PlayerAfkTicks[i] = 0; } PlayerLastPos[i][LastX] = PlayerCurrentPos[0]; PlayerLastPos[i][LastY] = PlayerCurrentPos[1]; PlayerLastPos[i][LastZ] = PlayerCurrentPos[2]; if(PlayerAfkTicks[i] == MAX_IDLE_TIME*60) //this line { AFK[i]= 1; SendClientMessage(i, 0x11B1FFAA, "Vocк foi impedido de upar!"); SetPlayerVirtualWorld(i, 1); SetCameraBehindPlayer(i); TogglePlayerControllable(i,0); TextDrawShowForPlayer(i,AfkText); TextDrawShowForPlayer(i,AfkBackText); }
new maxtime = floatround((MAX_IDLE_TIME * 60), floatround_ceil);
if(PlayerAfkTicks[i] >= maxtime)
(17358) : error 029: invalid expression, assumed zero (17358) : error 029: invalid expression, assumed zero
PlayerAfkTicks[i] ++; } else { PlayerAfkTicks[i] = 0; } PlayerLastPos[i][LastX] = PlayerCurrentPos[0]; PlayerLastPos[i][LastY] = PlayerCurrentPos[1]; PlayerLastPos[i][LastZ] = PlayerCurrentPos[2]; new maxtime = floatround((MAX_IDLE_TIME * 60), floatround_ceil); if(PlayerAfkTicks[i] >= maxtime) { AFK[i]= 1; SendClientMessage(i, 0x11B1FFAA, "Vocк foi impedido de upar!"); SetPlayerVirtualWorld(i, 1); SetCameraBehindPlayer(i); TogglePlayerControllable(i,0); TextDrawShowForPlayer(i,AfkText); TextDrawShowForPlayer(i,AfkBackText); }
#define MAX_IDLE_TIME 15 // 15 minutes
new PlayerAfkTicks[MAX_PLAYERS];
new AFK[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
PlayerAfkTicks[playerid] = 0;
AFK[MAX_PLAYERS];
return 1;
}
public OnGameModeInit()
{
SetTimer("OneSecond", 1000, 1);
return 1;
}
forward OneSecond();
public OneSecond()
{
for(new x = 0; x < MAX_PLAYERS; x++)
{
new maxtime = floatround((MAX_IDLE_TIME * 60), floatround_ceil);
if(PlayerAfkTicks[x] >= maxtime)
{
AFK[x] = 1;
}
}
return 1;
}
That's weird, it works fine for me. Here's what I have:
pawn Код:
|
error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint" error 017: undefined symbol "CPS_AddCheckpoint"