SA-MP Forums Archive
Specoff giving me errorrs :& - 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: Specoff giving me errorrs :& (/showthread.php?tid=425845)



Specoff giving me errorrs :& - MiGu3X - 27.03.2013

FULL COMMANDS :

pawn Код:
CMD:spec(playerid, params[])
{
    new id;
    if(PlayerInfo[playerid][pAdmin] >= 3 )
    {
        if(sscanf(params,"u", id))
            return SendClientMessage(playerid, DEEPPINK, "USAGE: /spec <id>");

        if(id == playerid)
            return SendClientMessage(playerid,DEEPPINK,"ERROR: You can't spec yourself.");

        if(id == INVALID_PLAYER_ID)
            return SendClientMessage(playerid, DEEPPINK, "ERROR: Player is not connected.");

        if(IsSpecing[playerid] == 1)
            return SendClientMessage(playerid,DEEPPINK,"ERROR: You are already specing someone.");

        GetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);
        Inter[playerid] = GetPlayerInterior(playerid);
        vWorld[playerid] = GetPlayerVirtualWorld(playerid);
        TogglePlayerSpectating(playerid, true);

        if(IsPlayerInAnyVehicle(id))
        {
            if(GetPlayerInterior(id) > 0)
            {
                SetPlayerInterior(playerid,GetPlayerInterior(id));
            }
            if(GetPlayerVirtualWorld(id) > 0)
            {
                SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
            }
            PlayerSpectateVehicle(playerid,GetPlayerVehicleID(id));
        }
        else
        {
            if(GetPlayerInterior(id) > 0)
            {
                SetPlayerInterior(playerid,GetPlayerInterior(id));
            }
            if(GetPlayerVirtualWorld(id) > 0)
            {
                SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
            }
            PlayerSpectatePlayer(playerid,id);
        }
       
        GetPlayerName(id, Name, sizeof(Name));
        format(String, sizeof(String),"You have started to spectate %s.",Name);
        SendClientMessage(playerid, GREY, String);
       
        IsSpecing[playerid] = 1;
        IsBeingSpeced[id] = 1;
        spectatorid[playerid] = id;
        return 1;
}

CMD:specoff(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 3)
    {
        {
          if(IsSpecing[playerid] == 0)
                return SendClientMessage(playerid, DEEPPINK, "ERROR: You are not spectating anyone.");
        }
        else
        {
            TogglePlayerSpectating(playerid, 0);
        }
    }
    else return SendClientMessage(playerid, DEEPPINK, "ERROR: You must be level 3 to use this command!");
    return 1;
}
ERROR

Код:
C:\Users\user7\Desktop\extensionss\Server\gamemodes\new.pwn(1400) : warning 217: loose indentation
C:\Users\user7\Desktop\extensionss\Server\gamemodes\new.pwn(1400) : error 029: invalid expression, assumed zero
C:\Users\user7\Desktop\extensionss\Server\gamemodes\new.pwn(1400) : error 017: undefined symbol "cmd_specoff"
C:\Users\user7\Desktop\extensionss\Server\gamemodes\new.pwn(1400) : error 029: invalid expression, assumed zero
C:\Users\user7\Desktop\extensionss\Server\gamemodes\new.pwn(1400) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Respuesta: Specoff giving me errorrs :& - MiGu3X - 27.03.2013

Help plese :&


Re: Specoff giving me errorrs :& - Joshman543 - 27.03.2013

You are missing a bracket after the final return on CMDpec


Re: Specoff giving me errorrs :& - kamzaf - 27.03.2013

pawn Код:
CMD:specoff(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 3)
    {
        if(IsSpecing[playerid] == 1)
        {
            TogglePlayerSpectating(playerid, 0);
        }
        else return SendClientMessage(playerid, DEEPPINK, "ERROR: You are not spectating anyone.");
    }
    else return SendClientMessage(playerid, DEEPPINK, "ERROR: You must be level 3 to use this command!");
    return 1;
}