DestroyObject Not Working,
#1

Ok, so i'm working on this code and it works for the most part just when the script goes to destroy the object it doesnt....

Код:
forward WearArmor(playerid);
Код:
SetTimerEx("WearArmor", 100, true, "is", playerid);
Код:
public WearArmor(playerid)
{
	new Float:armorstatus;
	GetPlayerArmour(playerid, armorstatus);
	if(armorstatus >= 1)
	{
		armorvest[playerid] =  CreateObject(373,0,0,0,0,0,0);
		AttachObjectToPlayer(armorvest[playerid], playerid, 0, 0, 0.5, 0, 5, 0);
	}
	else
	{
		DestroyObject(armorvest[playerid]);
	}
	return 1;
}
The object just never get's destroyed when the armor get's below 1
Reply
#2

Quote:
Originally Posted by External-Life
Посмотреть сообщение
Ok, so i'm working on this code and it works for the most part just when the script goes to destroy the object it doesnt....

Код:
forward WearArmor(playerid);
Код:
SetTimerEx("WearArmor", 100, true, "is", playerid);
Код:
public WearArmor(playerid)
{
	new Float:armorstatus;
	GetPlayerArmour(playerid, armorstatus);
	if(armorstatus >= 1)
	{
		armorvest[playerid] =  CreateObject(373,0,0,0,0,0,0);
		AttachObjectToPlayer(armorvest[playerid], playerid, 0, 0, 0.5, 0, 5, 0);
	}
	else
	{
		DestroyObject(armorvest[playerid]);
	}
	return 1;
}
The object just never get's destroyed when the armor get's below 1
How do you even set the armorstatus variable to lower then 1 ?
Reply
#3

Well if the PlayersArmour = 0 then it would set the armor variable to 0 right? also, i tried this with >= 2 to test if that was maybe the issue same problem the object is not destroyed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)