Spec Cmd
#1

Код:
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?
Reply
#2

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
Reply
#3

It happen always.
Reply
#4

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.
Reply
#5

I think not that Onplayerdeath is called.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)