undefined symbol: playerid ? - 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: undefined symbol: playerid ? (
/showthread.php?tid=568213)
undefined symbol: playerid ? -
Guss - 20.03.2015
Hello, when I compile I get this error:
Quote:
error 017: undefined symbol "playerid"
|
Code:
PHP код:
GameTextForPlayer( playerid, "Welcome", 5000, 1);
Why?
Re: undefined symbol: playerid ? -
Isolated - 20.03.2015
Show the callback where that code is placed.
Re: undefined symbol: playerid ? -
CalvinC - 20.03.2015
You haven't defined playerid, as you can see, in some callbacks it has a playerid parameter, where others might not.
So you can use it here: OnPlayerConnect(playerid)
But not here: OnGameModeInit()
Respuesta: undefined symbol: playerid ? -
Guss - 20.03.2015
It's ok. I was doing on a stock
Re: undefined symbol: playerid ? -
MrCallum - 20.03.2015
Dude, use it under OnPlayerConnect(playerid);
(playerid) is not defined in OnGameModeInit(); It does not have to be due to it being for the gamemode loading up not the player....
Re: undefined symbol: playerid ? -
CalvinC - 20.03.2015
If you use a function, you have to add the playerid parameter yourself.
MyFunc(playerid)
Re: undefined symbol: playerid ? -
Bester - 20.03.2015
you can use playerid only under a function or under a callback
if you want to say Welcome to your player when they connect then just do it like this
Код:
public OnPlayerConnect(playerid){
GameTextForPlayer( playerid, "Welcome", 5000, 1);
return 1;}
Re: undefined symbol: playerid ? -
TwinkiDaBoss - 20.03.2015
instead of stock