settimer so easy but a bit error
#1

Код:
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"
Reply
#2

You forgot "playerid"

pawn Код:
forward Score(playerid);

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

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
Reply
#4

Try SetTimerEx
Reply
#5

i tell u plz make code i am fail
Reply
#6

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

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);
        }
    }
}
Reply
#8

i hope RUT your code work:S
Reply
#9

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...
Reply
#10

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!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)