12.04.2008, 14:33
Is it possible to use a variable in a filterscript that is set in another (compiled) filterscript or a gamemode script?
Like this:
[code=Filterscript 1.pwn]
#include <a_samp>
gPlayerMoney[playerid];
public OnPlayerConnect(playerid)
{
gPlayerMoney[playerid] = 50000;
}
[/code]
[code=Filterscript 2.pwn]
#include <a_samp>
extern gPlayerMoney[playerid]; // maybe replace extern with a special declaration?!
public OnPlayerDeath(playerid)
{
gPlayerMoney[playerid] =- 1000;
}
[/code]
EDIT: Just found a workaround... Saving the variable to a File and then reading it from the other Filterscript...
Like this:
[code=Filterscript 1.pwn]
#include <a_samp>
gPlayerMoney[playerid];
public OnPlayerConnect(playerid)
{
gPlayerMoney[playerid] = 50000;
}
[/code]
[code=Filterscript 2.pwn]
#include <a_samp>
extern gPlayerMoney[playerid]; // maybe replace extern with a special declaration?!
public OnPlayerDeath(playerid)
{
gPlayerMoney[playerid] =- 1000;
}
[/code]
EDIT: Just found a workaround... Saving the variable to a File and then reading it from the other Filterscript...