Convert FS to INC
#1

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(playeridreason)
{
    
pMoney[playerid] = 0;
    return 
1;
}
stock a_GivePlayerMoney(playeridmoney)
{
    
pMoney[playerid] += money;
    
GivePlayerMoney(playeridmoney);
}
stock a_SetPlayerMoney(playeridmoney)
{
    
pMoney[playerid] = money;
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playeridmoney);

Reply
#2

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.
Reply
#3

Thanks for your help
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)