Spectating problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Spectating problem (
/showthread.php?tid=492235)
Spectating problem -
Duck4coder - 02.02.2014
Hello guys, got a problem with my spec command :/
Код:
TogglePlayerSpectating(playerid, true);
PlayerSpectatePlayer(playerid, pid, SPECTATE_MODE_NORMAL);
Get the errors
Код:
error 029: invalid expression, assumed zero //On the first line
warning 217: loose indentation //On the second line.
Re: Spectating problem -
donhu789 - 03.02.2014
TogglePlayerSpectating(playerid, 1);
Show Me tthe full code of this
PlayerSpectatePlayer(playerid, pid, SPECTATE_MODE_NORMAL);
Re: Spectating problem -
Duck4coder - 05.02.2014
Код:
CMD:spec(playerid, params[])
{
new pid;
if(Player_Data[playerid][Adminlevel] >= 2)
{
if(sscanf(params, "u", pid)) return SCM(playerid, GREY, "[SERVER]: Usage: /spec [playerid/name]");
if(pid != playerid)
{
if(pid != INVALID_PLAYER_ID)
{
` TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, pid);
format(string2, sizeof(string2), "You are now speccing %s", PlayerName(playerid));
SCM(playerid, YELLOW, string2);
}
else return SCM(playerid, GREY, "That player isn't connected.");
}
else return SCM(playerid, GREY, "You cannot spectate yourself.");
}
else return SCM(playerid, GREY, UNAUTHORIZED);
return 1;
}
Sorry for late response
Re: Spectating problem -
Konstantinos - 05.02.2014
pawn Код:
if(pid != INVALID_PLAYER_ID)
{
` TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, pid);
format(string2, sizeof(string2), "You are now speccing %s", PlayerName(playerid));
SCM(playerid, YELLOW, string2);
}
There's "` " before TogglePlayerSpectating function which is invalid. Just delete it.
Re: Spectating problem -
Duck4coder - 05.02.2014
Oh wow, how did I not see that, thanks guys :P