Spectate help appreciated
#5

here use mine: (also thanks to seifs adminscript for providing an excellent example)
pawn Код:
if(strcmp(cmd,"/Spec",true)==0)
{//  \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ needs to be changed to whatever system of admin levels you have
  if(AdminLevel<The required level)return SendClientMessage(playerid,RED,"You are not an admin with the requried level.");
  tmp=strtok(cmdtext,idx);
  if(strlen(tmp)==0)return SendClientMessage(playerid,RED,"You need to type: (/Spec (Playername/PlayerID)) or (/SpecOff)");
  otherplayer=ReturnUser(tmp);
  if(otherplayer==INVALID_PLAYER_ID)return SendClientMessage(playerid,RED,"That player does not exist!");
  TogglePlayerSpectating(playerid,1);
  if(IsPlayerInAnyVehicle(otherplayer)==1)PlayerSpectateVehicle(playerid,GetPlayerVehicleID(otherplayer));
  else PlayerSpectatePlayer(playerid,otherplayer);
  SendClientMessage(playerid,GREEN,"To stop spectating use: /Specoff");
  return 1;
}
For this to work you will need strtok and to change otherplayer with whatever you use the player id the command affects.

And you'll need to have RED defined or replace it with the red hex code. (The same with GREEN).

Also here's spectate off:
pawn Код:
if(strcmp(cmd,"/SpecOff",true)==0)
{
  TogglePlayerSpectating(playerid,0);
  SetPlayerVirtualWorld(playerid,0);
  SetPlayerInterior(playerid,0);
  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: 3 Guest(s)