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;
}
if(strcmp(cmd,"/SpecOff",true)==0)
{
TogglePlayerSpectating(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid,0);
return 1;
}
Originally Posted by Calgon
We require one that allows rotation by the move of the mouse angle / key angles. I've fixed the death error.
|
C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1524) : error 017: undefined symbol "AdminLevel" C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1525) : error 017: undefined symbol "tmp" C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1525) : error 017: undefined symbol "strtok" C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1526) : error 017: undefined symbol "tmp" C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1527) : error 017: undefined symbol "otherplayer" C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1527) : error 017: undefined symbol "ReturnUser" C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1528) : error 017: undefined symbol "otherplayer" C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1530) : error 017: undefined symbol "otherplayer" C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1530) : error 017: undefined symbol "otherplayer" C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1531) : error 017: undefined symbol "otherplayer" C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1536) : error 017: undefined symbol "cmd" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 11 Errors.
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000AA,"You need to be Admin to do that!");
{
//paste the spec stuff here
}
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; }