Stack/heap collision
#1

Код:
[10:36:59] [debug] AMX backtrace:
[10:36:59] [debug] #0 ???????? in public OnPlayerUpdate () from tr.amx
[10:36:59] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[10:36:59] [debug]  Stack pointer (STK) is 0x4399C4, heap pointer (HEA) is 0x439A9C
Код:
public OnPlayerUpdate(playerid)
{	
	OnLookupComplete(playerid);
    SetPVarInt( playerid, "Is_AFK", 1 );

	new gunid = GetPlayerWeapon(playerid),
		str[80],
		wepname[ 24 ],
		Float:X2,
		Float:Y2,
		Float:Z2;

	GetWeaponName( gunid, wepname, sizeof(wepname) );

	if( gunid == 1 || gunid == 19 || gunid == 45 || gunid == 44 || gunid == 39 || gunid == 38 || gunid == 36 || gunid == 35 )
	{
		format   ( str, sizeof(str), "Иytino ginklа %s", wepname);
		TogglePlayerControllable(playerid, 0);
		ResetPlayerWeapons( playerid );
		ClearWeaponsFromInv( playerid );
	  	BanPlayer( "AC", playerid, str );
	}
    new iCurWeap = GetPlayerWeapon(playerid); // Return the player's current weapon
    if(iCurWeap != GetPVarInt(playerid, "iCurrentWeapon")) // If he changed weapons since the last update
    {
        // Lets call a callback named OnPlayerChangeWeapon
        OnPlayerChangeWeapon(playerid, GetPVarInt(playerid, "iCurrentWeapon"), iCurWeap);
        SetPVarInt(playerid, "iCurrentWeapon", iCurWeap); // Update the weapon variable
    }
	for(new i = 0; i < MAX_ROADBLOCKS; i++)
	{
	    if( !IsValidDynamicObject(RoadBlocks[ i ]) ) continue;
	    if( RID[ i ] != 1 ) continue;
	    GetDynamicObjectPos(RoadBlocks[ i ], X2, Y2, Z2);
 		if( IsPlayerInRangeOfPoint( playerid, 2.0, X2, Y2, Z2 ) )
	  	{
    		new panels, doors, lights, tires;
      		new carid = GetPlayerVehicleID( playerid );
			GetVehicleDamageStatus( carid, panels, doors, lights, tires );
	      	tires = encode_tires( 1, 1, 1, 1 );
	       	UpdateVehicleDamageStatus( carid, panels, doors, lights, tires );
	    	break;
		}
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)