SA-MP Forums Archive
[Help]Changing predefined variables - 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: [Help]Changing predefined variables (/showthread.php?tid=386386)



[Help]Changing predefined variables - Shadow19 - 20.10.2012

Ok I have a problem with this code I'm trying to make.
I want to be able to do /cmd [number]. and [number] changes in the following:
Код:
CreateObject([number], x , y, z, rx,ry,rz);
But the CreateObject is not in the same public function, it's in a whole other public function.
For example:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/cmd", cmdtext, true, 10) == 0)
	{
		set[number]
		return 1;
	}
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
        CreateObject([number],x,y,z,rx,ry,rz)
	return 1;
}



Re: [Help]Changing predefined variables - [HK]Ryder[AN] - 20.10.2012

Use global variables


Re: [Help]Changing predefined variables - Shadow19 - 20.10.2012

I'm sorry, I didn't mention this beforehand, but I'm quite new to pawno coding, so when you say "Use global variables" -Which I don't know what that means- I go "?" cause that doesn't help me, but thanks for the idea!