Function question
#4

No, variables are localized to the script they are in.

The only way to use variables across scripts is by using PVars.

Although you could also create a public function that changes that specific variable to whatever you want, and call it using CallRemoteFunction. For example:

pawn Код:
// In the Gamemode

public speedBoost(playerid, value)
{
    antispeedboost[playerid] = value;
    return 1;
}

// In the "race script" where you want it to be changed
CallRemoteFunction("speedBoost","ii",playerid,1);
pawn Код:
// In the Gamemode

public speedBoostValue(playerid, value)
{
    return antispeedboost[playerid];
}

// In the "race script"
antispeedboost[playerid] = CallRemoteFunction("speedBoost","i",playerid);
That's basically the alternative to using PVars, hope it helps!
Reply


Messages In This Thread
Function question - by knackworst - 28.11.2010, 09:48
Re: Function question - by iggy1 - 28.11.2010, 09:54
Re: Function question - by XePloiT - 28.11.2010, 09:54
Re: Function question - by JaTochNietDan - 28.11.2010, 09:58
Re: Function question - by knackworst - 28.11.2010, 10:12
Re: Function question - by iggy1 - 28.11.2010, 10:16
Re: Function question - by knackworst - 28.11.2010, 10:22
Re: Function question - by JaTochNietDan - 28.11.2010, 10:26
Re: Function question - by knackworst - 28.11.2010, 10:34
Re: Function question - by JaTochNietDan - 28.11.2010, 10:38

Forum Jump:


Users browsing this thread: 1 Guest(s)