SA-MP Forums Archive
Already defined but No! - 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: Already defined but No! (/showthread.php?tid=325560)



Already defined but No! - Gooday - 13.03.2012

Hi, this simple code shows the money and not the score:

pawn Код:
public OnPlayerUpdate(playerid)
{
    SetPlayerScore(playerid, GetPlayerMoney(playerid));
    return 1;
}
This is the ONLY one OnPlayerUpdate that i have but i see:

Quote:

C:\Users\Luca\Desktop\BaseScript\gamemodes\base.pw n(3725) : error 021: symbol already defined: "OnPlayUpdate"




Re: Already defined but No! - MP2 - 13.03.2012

Possibly a problem with brackets.


Re: Already defined but No! - Gooday - 13.03.2012

wich one? O.o


Re: Already defined but No! - TTJJ - 13.03.2012

Hi Gooday,

That warning usually means that the "OnPlayerUpdate" function has already been called somewhere else.

See if you have
pawn Код:
public OnPlayerUpdate()
anywhere else in your code/includes. If you do, you need to combine them.

Cheers,

TJ


Re: Already defined but No! - iPLEOMAX - 13.03.2012

"OnPlayUpdate"? Was that a typo?

If not, you should probably check your includes, maybe the library (include) author hasn't done a proper method of Hooking.


Re: Already defined but No! - Twisted_Insane - 13.03.2012

Look at the error clearly! It is telling you about "OnPlayUpdare", not "OnPlayerUpdate"! Search for it - as iPLEOMAX said - in your script, you probably got it twice defined!


Re: Already defined but No! - GtasaPoliceModz - 14.03.2012

Код:
public OnPlayerUpdate(playerid)
{
    SetPlayerScore(playerid, GetPlayerMoney(playerid));
	return 1;
}
Make sure you didn't retype the OnPlayerUpdate because i just put it my FCRP script to check if it would work it did so make sure you check that.