espter mode - 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: espter mode (
/showthread.php?tid=624843)
espter mode -
SukMathcuck - 23.12.2016
So, how do I fix this? I did this command, but it is not being what I wanted, next, when typing /observing ID, it works, when typing just /observe without the ID, exits from the espter mode, but does not work as I thought by experience, why?
PHP код:
ALTCOMMAND:ob->observar;
COMMAND:observar(playerid, params[])
{
if(GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "ERRO: Vocк deve estar logado para utilizar comandos.");
if(Account[playerid][pAdmin] <= 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "ERRO: Vocк nгo tem nнvel administrativo o suficiente.");
if(pAdmDuty[playerid] == 0 && Account[playerid][pAdmin] <= 7) return SendClientMessage(playerid, COLOR_LIGHTRED, "ERRO: Vocк nгo estб no modo administrador.");
new giveplayerid;
if(sscanf(params, "s[128]")) //error not fixed
{
if(aEspectador[playerid] == 1)
{
TogglePlayerSpectating(playerid, 0);
SendClientMessage(playerid, COLOR_SEAGREEN, "Vocк saiu do modo espectador.");
return aEspectador[playerid] = 0;
}
}
else if(sscanf(params, "i", giveplayerid))
return SendClientMessage(playerid, COLOR_WHITE2, "USE: (/ob)servar [playerid]");
if(aEspectador[playerid] == 0)
{
aEspectador[playerid] = 1;
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, giveplayerid, SPECTATE_MODE_NORMAL);
format(strglobal, sizeof(strglobal), "Vocк estб observando %s.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_SEAGREEN, strglobal);
}
return 1;
}
Re: espter mode -
StrikerZ - 24.12.2016
PHP код:
ALTCOMMAND:ob->observar;
COMMAND:observar(playerid, params[])
{
if(GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "ERRO: Vocк deve estar logado para utilizar comandos.");
if(Account[playerid][pAdmin] <= 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "ERRO: Vocк nгo tem nнvel administrativo o suficiente.");
if(pAdmDuty[playerid] == 0 && Account[playerid][pAdmin] <= 7) return SendClientMessage(playerid, COLOR_LIGHTRED, "ERRO: Vocк nгo estб no modo administrador.");
if(aEspectador[playerid] == 1)
{
if(isnull(params))
{
TogglePlayerSpectating(playerid, 0);
SendClientMessage(playerid, COLOR_SEAGREEN, "Vocк saiu do modo espectador.");
return aEspectador[playerid] = 0;
}
}
if(sscanf(params, "i", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE2, "USE: (/ob)servar [playerid]");
if(aEspectador[playerid] == 0)
{
aEspectador[playerid] = 1;
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, giveplayerid, SPECTATE_MODE_NORMAL);
format(strglobal, sizeof(strglobal), "Vocк estб observando %s.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_SEAGREEN, strglobal);
}
return 1;
}
Why are you making it so complicated? The above cmd will switch off that mod when u r in spec and u don't type any Id.else it'll show sscanf error