Function not running
#1

PHP код:
Rack_Refresh(rackid)
{
    if (
rackid != -&& RackData[rackid][rackExists])
    {
        static
            
str[64];
        if (
IsValidDynamicObject(RackData[rackid][rackObjects][4])) {
            
DestroyDynamicObject(RackData[rackid][rackObjects][4]);
        }
        if (
IsValidDynamic3DTextLabel(RackData[rackid][rackText3D])) {
            
DestroyDynamic3DTextLabel(RackData[rackid][rackText3D]);
        }
        
format(strsizeof(str), "[Rack %d]\n{FFFFFF}/gunrack to use this rack."rackid);
        
RackData[rackid][rackText3D] = CreateDynamic3DTextLabel(strCOLOR_DARKBLUERackData[rackid][rackPos][0], RackData[rackid][rackPos][1], RackData[rackid][rackPos][2] + 1.215.0INVALID_PLAYER_IDINVALID_VEHICLE_ID0RackData[rackid][rackWorld], RackData[rackid][rackInterior]);
        
Rack_RefreshGuns(rackid);
        
RackData[rackid][rackObjects][4] = CreateDynamicObject(2475RackData[rackid][rackPos][0], RackData[rackid][rackPos][1], RackData[rackid][rackPos][2], 0.00.0RackData[rackid][rackPos][3], RackData[rackid][rackWorld], RackData[rackid][rackInterior]);
        
printf("rack id = %i"rackid);
    }
    return 
1;

This code isn't running, I debugged it and it was actually running the rack ID you're editing but it doesn't change the location. Any ideas why?
Reply
#2

Instead of destroying why don't you try simply moving the object to another place?
It would request less code than this.
Reply
#3

It doesn't even delete the object, the code doesn't physically run. Not sure why.
Reply
#4

How do you know the code doesn't run? Are you sure it's actually being called? Also, are you using the crashdetect plugin?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)