Including inside a callback.
#1

All the include have inside then is RemoveBuildingForPlayer functions. I don't get any errors but the removebuildings don't work. Here's my code:

Код:
public OnPlayerConnect(playerid)
{ 
	// SECTION: MAPS

	#include "../Maps/Dealerships/Bahn/Bahn_Removes.pwn"
	#include "../Maps/Dealerships/Ottos/Ottos_Removes.pwn"
	#include "../Maps/Dealerships/Shody/Shody_Removes.pwn"
	#include "../Maps/Dealerships/Wang/Wang_Removes.pwn"

	#include "../Maps/GasPumps/FlintCounty/FlintCounty_Removes.pwn"
	#include "../Maps/GasPumps/Idlewood/Idlewood_Removes.pwn"

	return 1;
}
Reply
#2

Call a function instead or use y_hooks
Reply
#3

Quote:
Originally Posted by Verc
Посмотреть сообщение
Call a function instead.
And and put the includes inside it?
Reply
#4

Does anyone now why this doesn't work?
Reply
#5

Quote:
Originally Posted by Seifspeed
Посмотреть сообщение
And and put the includes inside it?
Include on top of your script just like normal.

Inside yourmap.pwn
PHP код:
RemoveBuilding(playerid)
{
     
RemoveBuildingForPlayer(...
     
//etc.

Call it in onplayerconnect.

I more recommend you to use y_hooks as it's much easier
Reply
#6

Quote:
Originally Posted by Verc
Посмотреть сообщение
Include on top of your script just like normal.

Inside yourmap.pwn
PHP код:
RemoveBuilding(playerid)
{
     
RemoveBuildingForPlayer(...
     
//etc.

Call it in onplayerconnect.

I more recommend you to use y_hooks as it's much easier
Thanks man. I used the code you gave me for my scenario but it kept on giving me errors. I had to add public in front of the function and forward it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)