SA-MP Forums Archive
undefined symbol - 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 (/showthread.php?tid=606351)



undefined symbol - Micko123 - 03.05.2016

Guys is this normal??
Код:
C:\Users\Admin\Desktop\Moj SRV\gamemodes\MojMod.pwn(1031) : error 017: undefined symbol "playerid"
C:\Users\Admin\Desktop\Moj SRV\gamemodes\MojMod.pwn(1032) : error 017: undefined symbol "playerid"
C:\Users\Admin\Desktop\Moj SRV\gamemodes\MojMod.pwn(1033) : error 017: undefined symbol "playerid"
C:\Users\Admin\Desktop\Moj SRV\gamemodes\MojMod.pwn(1034) : error 017: undefined symbol "playerid"
C:\Users\Admin\Desktop\Moj SRV\gamemodes\MojMod.pwn(1035) : error 017: undefined symbol "playerid"
C:\Users\Admin\Desktop\Moj SRV\gamemodes\MojMod.pwn(1036) : error 017: undefined symbol "playerid"
C:\Users\Admin\Desktop\Moj SRV\gamemodes\MojMod.pwn(1037) : error 017: undefined symbol "playerid"
C:\Users\Admin\Desktop\Moj SRV\gamemodes\MojMod.pwn(1038) : error 017: undefined symbol "playerid"
C:\Users\Admin\Desktop\Moj SRV\gamemodes\MojMod.pwn(1039) : error 017: undefined symbol "playerid"
C:\Users\Admin\Desktop\Moj SRV\gamemodes\MojMod.pwn(1040) : error 017: undefined symbol "playerid"
it is on these lines
Код:
RemoveBuildingForPlayer(playerid, 3369, 349.8750, 2438.2500, 15.4766, 0.25);
	RemoveBuildingForPlayer(playerid, 3369, 242.3984, 2438.2500, 15.4766, 0.25);
	RemoveBuildingForPlayer(playerid, 3367, 296.1406, 2438.2500, 15.4766, 0.25);
	RemoveBuildingForPlayer(playerid, 16598, 231.2813, 2545.7969, 20.0234, 0.25);
	RemoveBuildingForPlayer(playerid, 16602, 307.9531, 2543.4531, 20.3984, 0.25);
	RemoveBuildingForPlayer(playerid, 3269, 242.3984, 2438.2500, 15.4766, 0.25);
	RemoveBuildingForPlayer(playerid, 16599, 231.2813, 2545.7969, 20.0234, 0.25);
	RemoveBuildingForPlayer(playerid, 16098, 307.9531, 2543.4531, 20.3984, 0.25);
	RemoveBuildingForPlayer(playerid, 3271, 296.1406, 2438.2500, 15.4766, 0.25);
	RemoveBuildingForPlayer(playerid, 3269, 349.8750, 2438.2500, 15.4766, 0.25);
I fix this with
Код:
new playerid;
But is it normally to showthat error or my pawno is srewed??


Re: undefined symbol - henkas - 03.05.2016

You put code in callback who dont have playerid function so thats why put on stock like this
Код:
stock RemoveObjectsForPlayer(playerid)
{
you remove object codes
}
And put this code on OnplayerConnect callback
Код:
RemoveObjectsForPlayer(playerid);



Re: undefined symbol - Micko123 - 03.05.2016

Okay will do that thanks


Re: undefined symbol - Ritzy2K - 03.05.2016

Did you add this under OnGameModeInit? It doesn't have a parameter called "playerid" you should remove these when a player connects, the fix you did above will not be detected by compile as an issue but this won't work either. You can directly add them under OnPlayerConnect or maybe use as henkas said.


Re: undefined symbol - Micko123 - 03.05.2016

Quote:
Originally Posted by [ND]xXZeusXx.
Посмотреть сообщение
Did you add this under OnGameModeInit? It doesn't have a parameter called "playerid" you should remove these when a player connects, the fix you did above will not be detected by compile as an issue but this won't work either. You can directly add them under OnPlayerConnect or maybe use as henkas said.
Actually after i added new playerid it worked so...


Re: undefined symbol - jlalt - 03.05.2016

Quote:
Originally Posted by Micko123
Посмотреть сообщение
Actually after i added new playerid it worked so...
new playerid; will always be id 0 so if you reached 1000 players even it gonna keep removing id 0 objects


Re: undefined symbol - Micko123 - 03.05.2016

What should i do then??
Should i put
Код:
RemoveObjectForPlayer
somwhere else?? Like on player connect like they said?


Re: undefined symbol - jlalt - 03.05.2016

Quote:
Originally Posted by Micko123
Посмотреть сообщение
What should i do then??
Should i put
Код:
RemoveObjectForPlayer
somwhere else?? Like on player connect like they said?
Yes you should put it under OnPlayerConnect Callback


Re: undefined symbol - Micko123 - 03.05.2016

Yup i did. Thank you