28.11.2010, 09:58
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:
That's basically the alternative to using PVars, hope it helps!
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);