Posts: 28
Threads: 7
Joined: May 2009
Reputation:
0
Hey,
I was wondering if you could help me with the spectate issue i'm having, can anyone hit me up with a spec system, which is only for admins - where you can either /spec or /recon, and make it so when an admin is spectating someone, as they move their mouse they can see behind the player, basically so the camera angle rotates.
Also, how do I make it so when we do /spec or /recon off they don't die?
Can anyone link me to a script as I don't have the slightest of clues.
Posts: 6,129
Threads: 36
Joined: Jan 2009
Posts: 6,129
Threads: 36
Joined: Jan 2009
Don't bump, it's not allowed.
Posts: 6,129
Threads: 36
Joined: Jan 2009
We require one that allows rotation by the move of the mouse angle / key angles. I've fixed the death error.
Posts: 6,129
Threads: 36
Joined: Jan 2009
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;
}