Spectate help appreciated
#10

The forum identation is ruined. D;

Код:
	if(strcmp(cmd,"/spec",true) == 0)
	{
  	if(PlayerInfo[playerid][pAdmin] < 1)
		{
			SendClientMessage(playerid, COLOR_YELLOW, "You're not authorised to spectate another player.");
			return 1;
		}
  	tmp = strtok(cmdtext,idx);
  	if(strlen(tmp) == 0)
		{
    	SendClientMessage(playerid, COLOR_GRAD1, "/spec [playerid/partofname] (or /specoff)");
			return 1;
		}
  	new otherplayer = ReturnUser(tmp);
  	if(otherplayer == INVALID_PLAYER_ID)
  	{
			SendClientMessage(playerid, COLOR_GREY, "Invalid player ID!");
			return 1;
		}
  	TogglePlayerSpectating(playerid,1);
  	if(IsPlayerInAnyVehicle(otherplayer)==1)
		{
		  new Float:health;
			new name[MAX_PLAYER_NAME];
			GetPlayerName(otherplayer, name, sizeof(name));
			GetPlayerHealth(otherplayer, health);
			format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~y~%s(ID:%d)~n~~y~health:%.1f",name,otherplayer,health);
			GameTextForPlayer(i, string, 2500, 3);
			PlayerSpectateVehicle(playerid, GetPlayerVehicleID(otherplayer));
		}
  	else
		{
		  new Float:health;
			new name[MAX_PLAYER_NAME];
			GetPlayerName(otherplayer, name, sizeof(name));
			GetPlayerHealth(otherplayer, health);
			format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~y~%s(ID:%d)~n~~y~health:%.1f",name,otherplayer,health);
			GameTextForPlayer(i, string, 2500, 3);
			PlayerSpectatePlayer(playerid,otherplayer);
		}
  	SendClientMessage(playerid, COLOR_WHITE, "To finish your spectation session, use /specoff.");
  	return 1;
	}
	if(strcmp(cmd,"/specoff",true)==0)
	{
  	TogglePlayerSpectating(playerid,0);
  	SetPlayerVirtualWorld(playerid,0);
  	SetPlayerInterior(playerid,0);
  	SendClientMessage(playerid, COLOR_YELLOW, "You have finished spectating.");
  	return 1;
	}
Reply


Messages In This Thread
Spectate help appreciated - by Marclang - 28.05.2009, 21:21
Re: Spectate help appreciated - by Calgon - 28.05.2009, 21:25
Re: Spectate help appreciated - by Marclang - 28.05.2009, 22:46
Re: Spectate help appreciated - by Calgon - 28.05.2009, 22:48
Re: Spectate help appreciated - by Badger(new) - 29.05.2009, 02:29
Re: Spectate help appreciated - by Calgon - 29.05.2009, 05:45
Re: Spectate help appreciated - by member - 29.05.2009, 09:27
Re: Spectate help appreciated - by Puzi - 29.05.2009, 09:35
Re: Spectate help appreciated - by member - 29.05.2009, 09:52
Re: Spectate help appreciated - by Calgon - 29.05.2009, 10:27

Forum Jump:


Users browsing this thread: 1 Guest(s)