SA-MP Forums Archive
undefined - 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: undefined (/showthread.php?tid=437923)



undefined - Nivniv2 - 17.05.2013

I've used "zone" in other lines, before this one but now its says that its undefined on this line.
pawn Код:
format(string, sizeof(string), "HQ: Location: %s, Crime: %s, Suspect: Unknown",zone, PlayerCrime[playerid][pAccusing]);



AW: undefined - HurtLocker - 17.05.2013

perhaps variable zone is not global


Re: undefined - Rillo - 17.05.2013

You have to define it again for that part of the code, above that line.


Re: AW: undefined - Nivniv2 - 17.05.2013

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
perhaps variable zone is not global
So how should i make it global..


AW: undefined - HurtLocker - 17.05.2013

define it out of any function like public/stock


Re: AW: undefined - Nivniv2 - 17.05.2013

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
define it out of any function like public/stock
mind to make the public and stock codes so i will add it?


AW: undefined - HurtLocker - 17.05.2013

no man thats not what I meant. if you use this for example:
pawn Код:
public example()
{
new var=26;
code code code
}
and then try to use variable var here:
pawn Код:
CMD:fire(playerid, params[])
{
GivePlayerWeapon(playerid, var, 500);
return 1;
}
you will receive message that var is undefined while you think that you did define it.