SA-MP Forums Archive
Spec Cmd - 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: Spec Cmd (/showthread.php?tid=415954)



Spec Cmd - Blackazur - 15.02.2013

Код:
CMD:spec(playerid,params[])
{
    if(pInfo[playerid][pAdminLevel] >= 1)
    {
	new id;
	if(sscanf(params,"d",id)) return SendClientMessage(playerid,-1,""chat"""Usage: /spec <id>");
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,""chat"""Player is not connected!");

	TogglePlayerSpectating(playerid,1);
    PlayerSpectatePlayer(playerid,id);
    SetPlayerInterior(playerid,GetPlayerInterior(id));
	}
	return 1;
}
When an Admin use it, the Admin die, know everyone why that happen?


Re: Spec Cmd - dusk - 15.02.2013

Does it happen always?

Maybe he dies when the player is in car. Because for spectating cars there's https://sampwiki.blast.hk/wiki/PlayerSpectateVehicle


AW: Spec Cmd - Blackazur - 15.02.2013

It happen always.


Re: Spec Cmd - 2KY - 15.02.2013

When you spectate & unspectate someone, OnPlayerDeath is called afaik. Try setting a variable and OnPlayerDeath, return 0 if that variable is one, making the death invalid.


AW: Spec Cmd - Blackazur - 19.02.2013

I think not that Onplayerdeath is called.