[ajuda]Erro
#1

oq ta errado?

Codigo:
pawn Код:
public RouboBanco(playerid) {
    KillTimer(tempobanco);
    if(!PlayerToPoint(8.0,playerid,2144.2131,1641.8859,993.5761)) {
        format(gstring, sizeof(gstring), "%s e os %s nгo conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
        SendClientMessageToAll(GetPlayerColor(playerid), gstring);
        SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб no cofre do banco.");
        ProvocoBanco[playerid] = 0; roubando[playerid] = 0; roubobanco = 0; KillTimer(tempobanco); temporoubobanco = 0;
        ClearAnimations(playerid);
        RemovePlayerAttachedObject(playerid,0);
        return 1;
    }
    new grana = 1000 + random(60000);
    if(PlayerToPoint(10.0,playerid,2144.2131,1641.8859,993.5761)) {
        new var032=0;
        if (PlayerInfo[playerid][pLider] != 0) { var032 = PlayerInfo[playerid][pLider]; }
        else if (PlayerInfo[playerid][pMembro] != 0) { var032 = PlayerInfo[playerid][pMembro]; }
        if(ProvocoBanco[playerid] == 1) {
            format(gstring, sizeof(gstring), "%s e os %s conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
            SendClientMessageToAll(GetPlayerColor(playerid), gstring);
            roubando[playerid] = 0; roubobanco = 0; ProvocoBanco[playerid] = 0;
            RemovePlayerAttachedObject(playerid,0);
            ClearAnimations(playerid);
        }
        if (PlayerInfo[playerid][pLider] == var032 || PlayerInfo[playerid][pMembro] == var032)
        {
            new Float:p[3];
            GetPlayerPos(playerid,p[0],p[1],p[2]);
            if(!IsPlayerInRangeOfPoint(playerid, 10 , p[0], p[1], p[2]))
            SetPlayerCriminal(playerid,255, "Assalto ao Banco");
            GivePlayerMoney(playerid, grana);
            format(gstring, sizeof(gstring), "Vocк e os %s roubaram $%d do cofre do Banco!",NomeORG(playerid), grana);
            SendClientMessage(playerid, COLOR_YELLOW, gstring);
                    }
                }
            }
        }
    }
    return 1;
}
Erros:
pawn Код:
(64277) : warning 209: function "RouboBanco" should return a value
(64278) : error 054: unmatched closing brace ("}")
(64280) : error 010: invalid function or declaration
Reply
#2

pawn Код:
public RouboBanco(playerid)
{
    KillTimer(tempobanco);
    new grana = 1000 + random(60000), Float:p[3];
    if(!PlayerToPoint(8.0,playerid,2144.2131,1641.8859,993.5761))
    {
        format(gstring, sizeof(gstring), "%s e os %s nгo conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
        SendClientMessageToAll(GetPlayerColor(playerid), gstring);
        SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб no cofre do banco.");
        ProvocoBanco[playerid] = 0; roubando[playerid] = 0; roubobanco = 0; KillTimer(tempobanco); temporoubobanco = 0;
        ClearAnimations(playerid);
        RemovePlayerAttachedObject(playerid,0);
        return 1;
    }
    if(PlayerToPoint(10.0,playerid,2144.2131,1641.8859,993.5761))
    {
        new var032=0;
        if (PlayerInfo[playerid][pLider] != 0)
        {
            var032 = PlayerInfo[playerid][pLider];
        }
        else if (PlayerInfo[playerid][pMembro] != 0)
        {
            var032 = PlayerInfo[playerid][pMembro];
        }
        if(ProvocoBanco[playerid] == 1)
        {
            format(gstring, sizeof(gstring), "%s e os %s conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
            SendClientMessageToAll(GetPlayerColor(playerid), gstring);
            roubando[playerid] = 0; roubobanco = 0; ProvocoBanco[playerid] = 0;
            RemovePlayerAttachedObject(playerid,0);
            ClearAnimations(playerid);
            return 1;
        }
        if (PlayerInfo[playerid][pLider] == var032 || PlayerInfo[playerid][pMembro] == var032)
        {
            GetPlayerPos(playerid,p[0],p[1],p[2]);
            if(!IsPlayerInRangeOfPoint(playerid, 10 , p[0], p[1], p[2]))
            SetPlayerCriminal(playerid,255, "Assalto ao Banco");
            GivePlayerMoney(playerid, grana);
            format(gstring, sizeof(gstring), "Vocк e os %s roubaram $%d do cofre do Banco!",NomeORG(playerid), grana);
            SendClientMessage(playerid, COLOR_YELLOW, gstring);
            return 1;
        }
    }
    return 1;
}
Reply
#3

nem deu certo ;s
Reply
#4

TEntae '-'
pawn Код:
public RouboBanco(playerid) {
    KillTimer(tempobanco);
    if(!PlayerToPoint(8.0,playerid,2144.2131,1641.8859,993.5761)) {
        format(gstring, sizeof(gstring), "%s e os %s nгo conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
        SendClientMessageToAll(GetPlayerColor(playerid), gstring);
        SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб no cofre do banco.");
        ProvocoBanco[playerid] = 0; roubando[playerid] = 0; roubobanco = 0; KillTimer(tempobanco); temporoubobanco = 0;
        ClearAnimations(playerid);
        RemovePlayerAttachedObject(playerid,0);
        return 1;
    }
    new grana = 1000 + random(60000);
    if(PlayerToPoint(10.0,playerid,2144.2131,1641.8859,993.5761)) {
        new var032=0;
        if (PlayerInfo[playerid][pLider] != 0) { var032 = PlayerInfo[playerid][pLider]; }
        else if (PlayerInfo[playerid][pMembro] != 0) { var032 = PlayerInfo[playerid][pMembro]; }
        if(ProvocoBanco[playerid] == 1) {
            format(gstring, sizeof(gstring), "%s e os %s conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
            SendClientMessageToAll(GetPlayerColor(playerid), gstring);
            roubando[playerid] = 0; roubobanco = 0; ProvocoBanco[playerid] = 0;
            RemovePlayerAttachedObject(playerid,0);
            ClearAnimations(playerid);
        }
        if (PlayerInfo[playerid][pLider] == var032 || PlayerInfo[playerid][pMembro] == var032)
        {
            new Float:p[3];
            GetPlayerPos(playerid,p[0],p[1],p[2]);
            if(!IsPlayerInRangeOfPoint(playerid, 10 , p[0], p[1], p[2]))
            SetPlayerCriminal(playerid,255, "Assalto ao Banco");
            GivePlayerMoney(playerid, grana);
            format(gstring, sizeof(gstring), "Vocк e os %s roubaram $%d do cofre do Banco!",NomeORG(playerid), grana);
            SendClientMessage(playerid, COLOR_YELLOW, gstring);
                    return 0;
      }
    }
    return 1;
}
Reply
#5

Tenta :
pawn Код:
#include <a_samp>

forward RouboBanco(playerid);
public RouboBanco(playerid)
{
    KillTimer(tempobanco);
    if(!PlayerToPoint(8.0,playerid,2144.2131,1641.8859,993.5761))
    {
        format(gstring, sizeof(gstring), "%s e os %s nгo conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
        SendClientMessageToAll(GetPlayerColor(playerid), gstring);
        SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб no cofre do banco.");
        ProvocoBanco[playerid] = 0; roubando[playerid] = 0; roubobanco = 0; KillTimer(tempobanco); temporoubobanco = 0;
        ClearAnimations(playerid);
        RemovePlayerAttachedObject(playerid,0);
        return 1;
    }
    new grana = 1000 + random(60000);
    if(PlayerToPoint(10.0,playerid,2144.2131,1641.8859,993.5761))
    {
        new var032=0;
        if (PlayerInfo[playerid][pLider] != 0)
        {
            var032 = PlayerInfo[playerid][pLider];
        }
        else if (PlayerInfo[playerid][pMembro] != 0)
        {
            var032 = PlayerInfo[playerid][pMembro];
        }
        if(ProvocoBanco[playerid] == 1)
        {
            format(gstring, sizeof(gstring), "%s e os %s conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
            SendClientMessageToAll(GetPlayerColor(playerid), gstring);
            roubando[playerid] = 0; roubobanco = 0; ProvocoBanco[playerid] = 0;
            RemovePlayerAttachedObject(playerid,0);
            ClearAnimations(playerid);
        }
        if (PlayerInfo[playerid][pLider] == var032 || PlayerInfo[playerid][pMembro] == var032)
        {
            new Float:p[3];
            GetPlayerPos(playerid,p[0],p[1],p[2]);
            if(!IsPlayerInRangeOfPoint(playerid, 10 , p[0], p[1], p[2]))
            SetPlayerCriminal(playerid,255, "Assalto ao Banco");
            GivePlayerMoney(playerid, grana);
            format(gstring, sizeof(gstring), "Vocк e os %s roubaram $%d do cofre do Banco!",NomeORG(playerid), grana);
            SendClientMessage(playerid, COLOR_YELLOW, gstring);
        }
    }
    return 1;
}
Reply
#6

compilo + so quem ganha a grana do roubo й quem rouba quem esta perto do cofre nao ganha ;s
Reply
#7

Qual compilo?
Meu ou do CidadeNovaRP?
@EDIT
Se foi o meu,tenta :
pawn Код:
public RouboBanco(playerid) {
    KillTimer(tempobanco);
    if(!PlayerToPoint(8.0,playerid,2144.2131,1641.8859,993.5761)) {
        format(gstring, sizeof(gstring), "%s e os %s nгo conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
        SendClientMessageToAll(GetPlayerColor(playerid), gstring);
        SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб no cofre do banco.");
        ProvocoBanco[playerid] = 0; roubando[playerid] = 0; roubobanco = 0; KillTimer(tempobanco); temporoubobanco = 0;
        ClearAnimations(playerid);
        RemovePlayerAttachedObject(playerid,0);
        return 1;
    }
    new grana = 1000 + random(60000);
    if(PlayerToPoint(10.0,playerid,2144.2131,1641.8859,993.5761)) {
        new var032=0;
        if (PlayerInfo[playerid][pLider] != 0) { var032 = PlayerInfo[playerid][pLider]; }
        else if (PlayerInfo[playerid][pMembro] != 0) { var032 = PlayerInfo[playerid][pMembro]; }
        if(ProvocoBanco[playerid] == 1) {
            format(gstring, sizeof(gstring), "%s e os %s conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
            SendClientMessageToAll(GetPlayerColor(playerid), gstring);
            roubando[playerid] = 0; roubobanco = 0; ProvocoBanco[playerid] = 0;
            RemovePlayerAttachedObject(playerid,0);
            ClearAnimations(playerid);
        }
        if (PlayerInfo[playerid][pLider] == var032 || PlayerInfo[playerid][pMembro] == var032)
        {
            new Float:p[3];
            GetPlayerPos(playerid,p[0],p[1],p[2]);
            if(!IsPlayerInRangeOfPoint(playerid, 10 , p[0], p[1], p[2]))
            SetPlayerCriminal(playerid,255, "Assalto ao Banco");
            GivePlayerMoney(playerid, grana);
            format(gstring, sizeof(gstring), "Vocк e os %s roubaram $%d do cofre do Banco!",NomeORG(playerid), grana);
            SendClientMessage(playerid, COLOR_YELLOW, gstring);
                    return 1;
    }
    return 1;
}
Reply
#8

Ta ae :
pawn Код:
public RouboBanco(playerid)
{
    KillTimer(tempobanco);
    if(!PlayerToPoint(8.0,playerid,2144.2131,1641.8859,993.5761))
    {
        format(gstring, sizeof(gstring), "%s e os %s nгo conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
        SendClientMessageToAll(GetPlayerColor(playerid), gstring);
        SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб no cofre do banco.");
        ProvocoBanco[playerid] = 0; roubando[playerid] = 0; roubobanco = 0; KillTimer(tempobanco); temporoubobanco = 0;
        ClearAnimations(playerid);
        RemovePlayerAttachedObject(playerid,0);
        return 1;
    }
    new grana = 1000 + random(60000);
    if(PlayerToPoint(10.0,playerid,2144.2131,1641.8859,993.5761))
    {
        new var032=0;
        if (PlayerInfo[playerid][pLider] != 0)
        {
            var032 = PlayerInfo[playerid][pLider];
        }
        else if (PlayerInfo[playerid][pMembro] != 0)
        {
            var032 = PlayerInfo[playerid][pMembro];
        }
        if(ProvocoBanco[playerid] == 1)
        {
            format(gstring, sizeof(gstring), "%s e os %s conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
            SendClientMessageToAll(GetPlayerColor(playerid), gstring);
            roubando[playerid] = 0; roubobanco = 0; ProvocoBanco[playerid] = 0;
            RemovePlayerAttachedObject(playerid,0);
            ClearAnimations(playerid);
        }
        for(new i=0;i<MAX_PLAYERS;i++)
        {
            if (PlayerInfo[playerid][pLider] == var032 || PlayerInfo[playerid][pMembro] == var032)
            {
                new Float:p[3];
                GetPlayerPos(i,p[0],p[1],p[2]);
                if(!IsPlayerInRangeOfPoint(i, 10 , p[0], p[1], p[2]))
                SetPlayerCriminal(i,255, "Assalto ao Banco");
                GivePlayerMoney(i, grana);
                format(gstring, sizeof(gstring), "Vocк e os %s roubaram $%d do cofre do Banco!",NomeORG(playerid), grana);
                SendClientMessage(i, COLOR_YELLOW, gstring);
            }
        }
    }
    return 1;
}
Reply
#9

o teu primeiro code tinha compilado richard + n tinha dado certo, o segundo nem compilo eo do cidadevona compilo + ndeu certo tbm ;s
Reply
#10

opa deu certo cidadenova so nao seto o SetPlayerCriminal
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)