Convert FS to INC - 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: Convert FS to INC (
/showthread.php?tid=578120)
Convert FS to INC -
INKISICION - 16.06.2015
I wonder as I define it for use in a Gamemode and FS
as it gives me these errors
in my FS
#include <MyInc>
and errors
error 021: symbol already defined: "Streamer_OnPlayerConnect"
error 021: symbol already defined: "ppb_OnPlayerDisconnect"
PHP код:
new pMoney[MAX_PLAYERS];
//Code - for use as .INC
public OnPlayerConnect(playerid)
{
pMoney[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
pMoney[playerid] = 0;
return 1;
}
stock a_GivePlayerMoney(playerid, money)
{
pMoney[playerid] += money;
GivePlayerMoney(playerid, money);
}
stock a_SetPlayerMoney(playerid, money)
{
pMoney[playerid] = money;
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, money);
}
Re: Convert FS to INC -
b3nz - 16.06.2015
To use it in an include, you need to hook the callbacks, because it conflicts with other includes (in this case - streamer plugin's include and one more which I don't know.)
Take a look or this:
https://sampforum.blast.hk/showthread.php?tid=570910
Or, you could use y_hooks, although I wouldn't recommend to use it if you're going to use the whole YSI library for this script only.
Re: Convert FS to INC -
INKISICION - 16.06.2015
Thanks for your help