SA-MP Forums Archive
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(playeridparams[])
{
    if(
GetPVarInt(playerid"PlayerLogged") == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"ERRO: Vocк deve estar logado para utilizar comandos.");
    if(
Account[playerid][pAdmin] <= 1) return SendClientMessage(playeridCOLOR_LIGHTRED"ERRO: Vocк nгo tem nнvel administrativo o suficiente.");
    if(
pAdmDuty[playerid] == && Account[playerid][pAdmin] <= 7) return SendClientMessage(playeridCOLOR_LIGHTRED"ERRO: Vocк nгo estб no modo administrador.");
    new 
giveplayerid;
    if(
sscanf(params"s[128]")) //error not fixed
    
{
         if(
aEspectador[playerid] == 1)
        {
            
TogglePlayerSpectating(playerid0);
            
SendClientMessage(playeridCOLOR_SEAGREEN"Vocк saiu do modo espectador.");
            return 
aEspectador[playerid] = 0;
        }
    }
    else if(
sscanf(params"i"giveplayerid))
        return 
SendClientMessage(playeridCOLOR_WHITE2"USE: (/ob)servar [playerid]");
    if(
aEspectador[playerid] == 0)
    {
        
aEspectador[playerid] = 1;
        
TogglePlayerSpectating(playerid1);
        
PlayerSpectatePlayer(playeridgiveplayeridSPECTATE_MODE_NORMAL);
        
format(strglobalsizeof(strglobal), "Vocк estб observando %s."GetPlayerNameEx(playerid));
        
SendClientMessage(playeridCOLOR_SEAGREENstrglobal);
    }
    return 
1;




Re: espter mode - StrikerZ - 24.12.2016

PHP код:
ALTCOMMAND:ob->observar
COMMAND:observar(playeridparams[]) 

    if(
GetPVarInt(playerid"PlayerLogged") == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"ERRO: Vocк deve estar logado para utilizar comandos."); 
    if(
Account[playerid][pAdmin] <= 1) return SendClientMessage(playeridCOLOR_LIGHTRED"ERRO: Vocк nгo tem nнvel administrativo o suficiente."); 
    if(
pAdmDuty[playerid] == && Account[playerid][pAdmin] <= 7) return SendClientMessage(playeridCOLOR_LIGHTRED"ERRO: Vocк nгo estб no modo administrador.");
    if(
aEspectador[playerid] == 1)
    {
         if(
isnull(params))
         { 
            
TogglePlayerSpectating(playerid0); 
            
SendClientMessage(playeridCOLOR_SEAGREEN"Vocк saiu do modo espectador."); 
            return 
aEspectador[playerid] = 0
         }
    }
    if(
sscanf(params"i"giveplayerid)) return SendClientMessage(playeridCOLOR_WHITE2"USE: (/ob)servar [playerid]");
    
    if(
aEspectador[playerid] == 0
    { 
        
aEspectador[playerid] = 1
        
TogglePlayerSpectating(playerid1); 
        
PlayerSpectatePlayer(playeridgiveplayeridSPECTATE_MODE_NORMAL); 
        
format(strglobalsizeof(strglobal), "Vocк estб observando %s."GetPlayerNameEx(playerid)); 
        
SendClientMessage(playeridCOLOR_SEAGREENstrglobal); 
    } 
    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