[Help]Changing predefined variables
#1

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;
}
Reply
#2

Use global variables
Reply
#3

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)