Код:
if(hour >= 21 && hour <= 00) |
Seriously? How can a variable be both greater than 21 and smaller than zero at the same time? The compiler can tell you a lot but it can't fix stupid. Also I'm not sure why you use "else if" there because it is completely unrelated to the above if-statement.
|
I'm using that to check whether the time is between 21:00 and 00:00, if so, then spawn the NPC, else if the time is not between 21:00 and 00:00, destroy the NPC IF it exists.
|
if(hour >= 21 && hour <= 24) // 00:00 = 24:00
if(hour >= 21)
A number can't be higher than 21 and lower than 0, it's not logically possible. I think what you're trying to achieve is this:
Код:
if(hour >= 21 && hour <= 24) // 00:00 = 24:00 Код:
if(hour >= 21) |
Fixed that, thanks.
Anyways, what could be the problem of all of them despawning? |
Your data structure (the array) is very confusing. Can you show me some more code so I can figure how the data is stored?
|
enum p_quests { questID, questTitle[64], questType, questObject[10], Timer: questTimer } new E_QUEST[MAX_QUESTS][p_quests];
stock OnQuestsLoad() { new x, hour; gettime(hour); x = 1; E_QUEST[x][questID] = x; format(E_QUEST[x][questTitle], 64, "The Chilliad Mystery"); E_QUEST[x][questType] = 1; if(hour >= 21 && hour <= 00) { E_QUEST[x][questObject][OBJECT_GHOST] = CreateActor(55, -2255.3076,-1749.2554,487.6301,213.9964); E_QUEST[x][questObject][OBJECT_SMOKE] = CreateDynamicObject(18735, -2255.370605, -1749.652343, 485.269836, 0.000000, 0.000000, 0.000000); } x = 2; E_QUEST[x][questID] = x; format(E_QUEST[x][questTitle], 64, "The Collector"); E_QUEST[x][questObject][OBJECT_VEHICLE] = INVALID_VEHICLE_ID; E_QUEST[x][questType] = 2; x = 3; E_QUEST[x][questID] = x; format(E_QUEST[x][questTitle], 64, "The Racer"); E_QUEST[x][questObject][OBJECT_NPC] = CreateActor(55, -2127.6614,-452.7275,35.5313,272.9914); E_QUEST[x][questType] = 3; return 1; }