Originally Posted by Konstantinos
It's not something I can do via teamviewer.
Just do what the post says and also replace
pawn Код:
cache_get_field_content(i, "id", szResult, MainPipeline); crateid = strval(szResult);
to:
pawn Код:
cache_get_field_content(i, "id", szResult, MainPipeline); crateid = strval(szResult); printf( "crateid: %d", crateid );
I'm sure this is what causing this, crateid gets a value greater than 19, when it should get 0-19 (but it got 22 as the debug showed).
Run your server and if it gets crashed again, show us what it printed. If we make sure it's what I told you before, we'll need to prevent it. This:
pawn Код:
if(CrateInfo[crateid][InVehicle] != INVALID_VEHICLE_ID) { CrateInfo[crateid][crActive] = 0; CrateInfo[crateid][InVehicle] = INVALID_VEHICLE_ID; } if(CrateInfo[crateid][crActive]) { CrateInfo[crateid][InVehicle] = INVALID_VEHICLE_ID; CrateInfo[crateid][crObject] = CreateDynamicObject(964,CrateInfo[crateid][crX],CrateInfo[crateid][crY],CrateInfo[crateid][crZ],0.00000000,0.00000000,0.00000000); format(string, sizeof(string), "Serial Number: #%d\n High Grade Materials: %d/50", i, CrateInfo[i][GunQuantity]); CrateInfo[crateid][crLabel] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, CrateInfo[crateid][crX],CrateInfo[crateid][crY],CrateInfo[crateid][crZ]+1, 20.0, _, _, 1, 0, 0, _, 20.0); }
To:
pawn Код:
if( crateid > 0 && crateid < 20 ) { if(CrateInfo[crateid][InVehicle] != INVALID_VEHICLE_ID) { CrateInfo[crateid][crActive] = 0; CrateInfo[crateid][InVehicle] = INVALID_VEHICLE_ID; } if(CrateInfo[crateid][crActive]) { CrateInfo[crateid][InVehicle] = INVALID_VEHICLE_ID; CrateInfo[crateid][crObject] = CreateDynamicObject(964,CrateInfo[crateid][crX],CrateInfo[crateid][crY],CrateInfo[crateid][crZ],0.00000000,0.00000000,0.00000000); format(string, sizeof(string), "Serial Number: #%d\n High Grade Materials: %d/50", i, CrateInfo[i][GunQuantity]); CrateInfo[crateid][crLabel] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, CrateInfo[crateid][crX],CrateInfo[crateid][crY],CrateInfo[crateid][crZ]+1, 20.0, _, _, 1, 0, 0, _, 20.0); } }
|