SA-MP Forums Archive
Small Adding map to script help. - 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: Small Adding map to script help. (/showthread.php?tid=517654)



Small Adding map to script help. - Clergy - 06.06.2014

hello,

i tried adding Removebuildingforplayer map under filterscriptinit and gamemodeinit

but nuthin happens....

your help will do a great favour for me.

regards,


Re: Small Adding map to script help. - Adityz - 06.06.2014

Place it under Public OnPlayerConnect(playerid). It doesn't work if we place it under OnFilterScriptInit() / OnGameModeInit() as they don't have the playerid parameter.


Re: Small Adding map to script help. - Mriss - 06.06.2014

Do RemoveBuildingForPlayer under Onplayerconnect and compile it...


Re: Small Adding map to script help. - Parallex - 06.06.2014

Quote:
Originally Posted by Clergy
Посмотреть сообщение
hello,

i tried adding Removebuildingforplayer map under filterscriptinit and gamemodeinit

but nuthin happens....

your help will do a great favour for me.

regards,
OnGameModeInit or OnFilterscriptinIt have no "playerid" parameters. Whereas, Remove building code is like this: RemoveBuldingForPlayer(playerid, .....
You placed it in a wrong place and I'm sure you didn't even tried to compile the script, because, if you did - you may have got errors "Undefined Symbol "playerid" ".
Conclusion: Place RemoveBuldingForPlayer code under;
pawn Код:
public OnPlayerConnect(playerid)
{
 // Remove Bulding code here.
return 1;
}
The code which need to be under OnGameModeInit or OnFilterscriptInit is the CreateObject, CreateDynamicObject or whatever plugin you are using.

P.S: Don't forget to compile.