error 029: invalid expression, assumed zero
#9

Aww, no need to edit my last post to prevent nasty double posting, thanks c:

Try this:
Код:
// Top of the script
new DynamicGiftCreated = false;
new DynamicGiftOBJ; 
new Text3D:dynamicgift3DText;
/////
CMD:dynamicgift(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1337)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			SendClientMessageEx(playerid, COLOR_GREY, "You must be on foot to use this command.");
			return 1;
		}

		new string[128], Float:Position[4];
		if(!DynamicGiftCreated)
		{
			GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
			GetPlayerFacingAngle(playerid, Position[3]);
			DynamicGiftOBJ = CreateDynamicObject(19054, Position[0], Position[1], Position[2]-0.4, 0.0, 0.0, Position[3], -1, -1, -1, 200.0);
			dynamicgift3DText = CreateDynamic3DTextLabel("/getgift\nTogetagift.",COLOR_YELLOW,Position[0], Position[1], Position[2]+0.25,8.0);
			SetPlayerPosEx(playerid, Position[0], Position[1], Position[2]+3);
			format(string, sizeof(string), "AdmCmd: %s has placed the dynamic gift.", GetPlayerNameEx(playerid));
			ABroadCast( COLOR_LIGHTRED, string, 1337);
                        DynamicGiftCreated=true; // Ive forgot to add this..
		}
		else
		{
			DestroyDynamicObject(DynamicGiftOBJ);
			DynamicGiftCreated = false;
			DestroyDynamic3DTextLabel( dynamicgift3DText );
			format(string, sizeof(string), "AdmCmd: %s has destroyed the dynamic gift.", GetPlayerNameEx(playerid));
			ABroadCast( COLOR_LIGHTRED, string, 1337);
                       DynamicGiftCreated=false; // This either :<
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You can not you this command.");
	}
return 1;
}
I wrote it a little bit in hurry, but should work fine. Just let us know if everything's okay.
I've bolded the changes.

Greetings.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)