SA-MP Forums Archive
Streamer_GetIntData: invalid id... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Streamer_GetIntData: invalid id... (/showthread.php?tid=609324)



Streamer_GetIntData: invalid id... - SetPlayerNameTag - 11.06.2016

console spams this sometimes, why?


Re: Streamer_GetIntData: invalid id... - Konstantinos - 11.06.2016

Post the code where Streamer_GetIntData is used in your script.


Re: Streamer_GetIntData: invalid id... - SetPlayerNameTag - 11.06.2016

Quote:
Originally Posted by Konstantinos
View Post
Post the code where Streamer_GetIntData is used in your script.
Code:
stock UpdatePlayerBleeds(playerid)
{
	if(IsPlayerFalling(playerid) || IsPlayerJumping(playerid) || IsPlayerInWater(playerid))
		return false;
	new
			Float:pos[3];
	GetDynamicObjectPos(PlayerData[playerid][BleedObject][0], pos[0], pos[1], pos[2]);
	if(!IsPlayerInRangeOfPoint(playerid, PLAYER_BLEEDING_RANGE, pos[0], pos[1], (pos[2] + 0.99)))
	{
		new
				a = (PlayerData[playerid][Bleeding] - 1);
		while(a >= 0)
		{
			if((a - 1) == -1)
			{
				GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
				pos[2] -= 0.99;
			}
			else
				GetDynamicObjectPos(PlayerData[playerid][BleedObject][a - 1], pos[0], pos[1], pos[2]);
			SetDynamicObjectPos(PlayerData[playerid][BleedObject][a], pos[0], pos[1], pos[2]);
			if(GetPlayerInterior(playerid) != Streamer_GetIntData(STREAMER_TYPE_OBJECT, PlayerData[playerid][BleedObject][a], E_STREAMER_INTERIOR_ID))
				Streamer_SetIntData(STREAMER_TYPE_OBJECT, PlayerData[playerid][BleedObject][a], E_STREAMER_INTERIOR_ID, GetPlayerInterior(playerid));
			if(GetPlayerVirtualWorld(playerid) != Streamer_GetIntData(STREAMER_TYPE_OBJECT, PlayerData[playerid][BleedObject][a], E_STREAMER_WORLD_ID))
				Streamer_SetIntData(STREAMER_TYPE_OBJECT, PlayerData[playerid][BleedObject][a], E_STREAMER_WORLD_ID, GetPlayerVirtualWorld(playerid));
			a--;
		}
	}
	return true;
}



Re: Streamer_GetIntData: invalid id... - Konstantinos - 11.06.2016

Before setting the object position and check about interior/virtual word, check if the object is valid:
pawn Code:
if (!IsValidDynamicObject(PlayerData[playerid][BleedObject][a])) continue;

// code..



Re: Streamer_GetIntData: invalid id... - SetPlayerNameTag - 11.06.2016

Quote:
Originally Posted by Konstantinos
View Post
Before setting the object position and check about interior/virtual word, check if the object is valid:
pawn Code:
if (!IsValidDynamicObject(PlayerData[playerid][BleedObject][a])) continue;

// code..
Thanks! do you know how to detect if a object over the vehicle? I'm making a trunk system, people stores their weapon into trunk before spawn a object and they have to place this object inside the car, one problem, it's hard to detect if this object goes to sky or far from car. can you give me a framework? thanks.