SA-MP Forums Archive
settimer so easy but a bit error - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: settimer so easy but a bit error (/showthread.php?tid=255222)



settimer so easy but a bit error - cs_master - 14.05.2011

Код:
forward Score();

ongamemodeint
	SetTimer("Score", 30000, false); // Set a timer of 1000 miliseconds (1 second)

public Score()
{
	SetPlayerScore(playerid,GetPlayerScore(playerid)+1);
}
but i got error like this

Код:
H:\Documents and Settings\facker\Desktop\XtremePlanet\gamemodes\XS.pwn(4189) : error 017: undefined symbol "playerid"



Re: settimer so easy but a bit error - alpha500delta - 14.05.2011

You forgot "playerid"

pawn Код:
forward Score(playerid);

public Score(playerid)
{
    SetPlayerScore(playerid,GetPlayerScore(playerid)+1);
}



Re: settimer so easy but a bit error - cs_master - 14.05.2011

H:\Documents and Settings\Bilawal2o5o\Desktop\XtremePlanet\gamemode s\XS.pwn(50) : error 010: invalid function or declaration
again now this
what i do in settimer
or weree mistake plz make code with compile


Re: settimer so easy but a bit error - alpha500delta - 14.05.2011

Try SetTimerEx


Re: settimer so easy but a bit error - cs_master - 14.05.2011

i tell u plz make code i am fail


Re: settimer so easy but a bit error - alpha500delta - 14.05.2011

That code I gave you compiled fine for me. Must be a different problem.


Re: settimer so easy but a bit error - fiki574 - 14.05.2011

This is correct one:
Код:
forward GiveScore();
Код:
public OnFilterScriptInit()
{
    SetTimer("GiveScore", 30000, true);
}
Код:
public GiveScore()
{
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            SetPlayerScore(i, GetPlayerScore(i) + 1);
        }
    }
}



Re: settimer so easy but a bit error - cs_master - 14.05.2011

i hope RUT your code work:S


Re: settimer so easy but a bit error - Spectre - 14.05.2011

As Alpha said, you are neglecting to put "playerid" in your functions...

It's not:
public GiveScore()

It should be:
public GiveScore(playerid)

Same for any function...You have to pass it the information you want it to use...


Re: settimer so easy but a bit error - fiki574 - 14.05.2011

Quote:
Originally Posted by Spectre
Посмотреть сообщение
As Alpha said, you are neglecting to put "playerid" in your functions...

It's not:
public GiveScore()

It should be:
public GiveScore(playerid)

Same for any function...You have to pass it the information you want it to use...
Nope! I Use this on my server and it works! So you dont have playerid!