// top of the gamemode
new Object[500];
// somewhere else in the code
Object[0] = CA_CreateDynamicObject_DC(blah blah); // DOESN'T WORK FOR ME (NO OBJECT)
CA_CreateDynamicObject_DC(blah blah); // WORKS, BUT I NEED AN ID ASSIGNED
// what function should I use to destroy those objects?
CA_DestroyObject_DC(Object[0]); // will this work? there's no 'Dynamic' in its name
stock CA_DestroyObject_DC(index)
{
// Out of bounds
if(index < 0 || index >= MAX_CA_OBJECTS) return -1;
#if defined _Y_ITERATE_LOCAL_VERSION
if(Iter_Contains(CA_Objects, index))
{
new next;
Iter_SafeRemove(CA_Objects, index, next);
if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_OBJECT) DestroyObject(CA_ObjectList[index][ObjectID]);
#if defined STREAMER_TYPE_OBJECT
else if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_DYNAMIC) DestroyDynamicObject(CA_ObjectList[index][ObjectID]);
#endif
CA_DestroyObject(CA_ObjectList[index][ColdAndreadsID]);
return next;
}
#else
if(CA_ObjectList[index][ObjectUsed])
{
if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_OBJECT) DestroyObject(CA_ObjectList[index][ObjectID]);
#if defined STREAMER_TYPE_OBJECT
else if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_DYNAMIC) DestroyDynamicObject(CA_ObjectList[index][ObjectID]);
#endif
CA_ObjectList[index][ObjectUsed] = false;
CA_DestroyObject(CA_ObjectList[index][ColdAndreadsID]);
return 1;
}
#endif
return -1;
}
C:\path\PAWNO\include\colandreas.inc(407) : warning 202: number of arguments does not match definition
C:\path\PAWNO\include\colandreas.inc(407) : warning 202: number of arguments does not match definition
C:\path\PAWNO\include\colandreas.inc(405) : warning 203: symbol is never used: "priority"
C:\path\PAWNO\include\colandreas.inc(405) : warning 203: symbol is never used: "areaid"
C:\path\PAWNO\include\colandreas.inc(474) : warning 202: number of arguments does not match definition
C:\path\PAWNO\include\colandreas.inc(474) : warning 202: number of arguments does not match definition
C:\path\PAWNO\include\colandreas.inc(451) : warning 203: symbol is never used: "priority"
C:\path\PAWNO\include\colandreas.inc(451) : warning 203: symbol is never used: "areaid"
C:\path\PAWNO\include\colandreas.inc(1041) : error 010: invalid function or declaration
C:\path\PAWNO\include\colandreas.inc(1044) : error 021: symbol already defined: "CA_CreateObject_DC"
C:\path\PAWNO\include\colandreas.inc(1042) : error 010: invalid function or declaration
C:\path\PAWNO\include\colandreas.inc(1042 -- 1047) : error 021: symbol already defined: "CA_DestroyObject_DC"
C:\path\PAWNO\include\colandreas.inc(1042 -- 1047) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
It would be nice if someone cleaned up ColAndreas a bit at some point I don't really have time to get into it these days.
|
CA_GetObjectID(index);