SA-MP Forums Archive
Erro in Script - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Erro in Script (/showthread.php?tid=462089)



Erro in Script - Granmilk - 05.09.2013

is the following staff was stirring in the script of my server and modified some phrases that appear at the top it automatically at compile time that I gave this error...

Код:
(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
That and the part that is the line 17358


Код:
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);
}
heeeeelp me pleas..


Re: Erro in Script - Eyce - 05.09.2013

Could you try this:
pawn Код:
new maxtime = floatround((MAX_IDLE_TIME * 60), floatround_ceil);
if(PlayerAfkTicks[i] >= maxtime)



Re: Erro in Script - Granmilk - 05.09.2013

and now
Код:
(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);
}



Re: Erro in Script - Eyce - 05.09.2013

That's weird, it works fine for me. Here's what I have:
pawn Код:
#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;
}



Re: Erro in Script - Granmilk - 05.09.2013

Quote:
Originally Posted by Eyce
Посмотреть сообщение
That's weird, it works fine for me. Here's what I have:
pawn Код:
#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;
}
now
Код:
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"



Re: Erro in Script - Eyce - 05.09.2013

You don't have to copy the exact same script that I have, it must be incorporated in your script. I could fix it up for you, send me a private message.