Portal SAMP
[Ajuda] C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pw - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pw (/showthread.php?tid=1461)



C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pw - J.E - 28/07/2021

Estou com problema ao compilar me ajudem por favor
Código:
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) : error 029: invalid expression, assumed zero
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) :
215: expression has no effect
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) : error 001: expected token: ";", but found "if"
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) : error 036: empty statement
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) : fatal error 107: too many error messages on one line
Linhas:
Código:
#include <a_samp>
#include <Streamer>
#include <sscanf>

#define COLOR_PINK 0xFF66FFAA
#define COLOR_RED 0xF60000AA

forward roubar(playerid);
forward Robbank(playerid);

public OnPlayerCommandText  ()
{
new cmd[128];
else if(strcmp (cmd,"/roubar",true) ==0);
{
if(!IsPlayerInRangeOfPoint(playerid ,30,30, 1435.23, -981.54, 983.65 )) return SendClientMessage(playerid , COLOR_PING , "Voce Nao Esta no Cofre Banco /cofrebanco que estara Perto da Porta Azul");
if(IsPLayerInRangeOfPoint(playerid , 30 , 30, 1435.23, -981.54, 983.65 ))
{
new stringa[259];
new sendernome [MAX_PLAYER_NOME];
GetPlayerNome(playerid, sendername, sizeof(sendername));
formet(stringa,sizeof(stringa), "**%s esta Roubando o Banco **", sendername);
ProxDetector(15.0, playerid , stringa , COLOR_RED , COLOR_RED ,COLOR_RED , COLOR_RED , COLOR_RED);
SetTimerEx("Robbank" ,6000,0,"i", playerid);
Kils = SetTimerEx ("roubar" ,3500,1,"i",playerid);
ApplyAnimation(playerid, "ROB_BANK","CAT_Safe_Open_O" ,3.0,0,0,0,0,0);
robmoney[playerid] =random(15000);
}
return 1;
}

public roubar(playerid)
{
ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Open_O",3.0,0,0,0,0,0);
}

public Robbank(playerid)
{
SendClientMessage(playerid, COLOR_PINK, "Voce Roubou o Banco Agora Fuga, Para Nao ser Preso!!");
KillTimer(Kils);
ClearAnimations(playerid);
GivePlayerMoney(playerid, robmoney[playerid]);
return 1;
}




return 1;
}

public OnFilterScriptExit ()
{
        return 1;
}



RE: C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pw - Flowzada - 28/07/2021

(28/07/2021 11:56)J.E Escreveu: Estou com problema ao compilar me ajudem por favor
Código:
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) : error 029: invalid expression, assumed zero
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) :
215: expression has no effect
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) : error 001: expected token: ";", but found "if"
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) : error 036: empty statement
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) : fatal error 107: too many error messages on one line
Linhas:
Código:
#include <a_samp>
#include <Streamer>
#include <sscanf>

#define COLOR_PINK 0xFF66FFAA
#define COLOR_RED 0xF60000AA

forward roubar(playerid);
forward Robbank(playerid);

public OnPlayerCommandText  ()
{
new cmd[128];
else if(strcmp (cmd,"/roubar",true) ==0);
{
if(!IsPlayerInRangeOfPoint(playerid ,30,30, 1435.23, -981.54, 983.65 )) return SendClientMessage(playerid , COLOR_PING , "Voce Nao Esta no Cofre Banco /cofrebanco que estara Perto da Porta Azul");
if(IsPLayerInRangeOfPoint(playerid , 30 , 30, 1435.23, -981.54, 983.65 ))
{
new stringa[259];
new sendernome [MAX_PLAYER_NOME];
GetPlayerNome(playerid, sendername, sizeof(sendername));
formet(stringa,sizeof(stringa), "**%s esta Roubando o Banco **", sendername);
ProxDetector(15.0, playerid , stringa , COLOR_RED , COLOR_RED ,COLOR_RED , COLOR_RED , COLOR_RED);
SetTimerEx("Robbank" ,6000,0,"i", playerid);
Kils = SetTimerEx ("roubar" ,3500,1,"i",playerid);
ApplyAnimation(playerid, "ROB_BANK","CAT_Safe_Open_O" ,3.0,0,0,0,0,0);
robmoney[playerid] =random(15000);
}
return 1;
}

public roubar(playerid)
{
ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Open_O",3.0,0,0,0,0,0);
}

public Robbank(playerid)
{
SendClientMessage(playerid, COLOR_PINK, "Voce Roubou o Banco Agora Fuga, Para Nao ser Preso!!");
KillTimer(Kils);
ClearAnimations(playerid);
GivePlayerMoney(playerid, robmoney[playerid]);
return 1;
}




return 1;
}

public OnFilterScriptExit ()
{
        return 1;
}

Qual o sentido desse else if? Apague ele.


RE: C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pw - J.E - 28/07/2021

(28/07/2021 11:59)Flowzada Escreveu:
(28/07/2021 11:56)J.E Escreveu: Estou com problema ao compilar me ajudem por favor
Código:
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) : error 029: invalid expression, assumed zero
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) :
215: expression has no effect
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) : error 001: expected token: ";", but found "if"
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) : error 036: empty statement
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(14) : fatal error 107: too many error messages on one line
Linhas:
Código:
#include <a_samp>
#include <Streamer>
#include <sscanf>

#define COLOR_PINK 0xFF66FFAA
#define COLOR_RED 0xF60000AA

forward roubar(playerid);
forward Robbank(playerid);

public OnPlayerCommandText  ()
{
new cmd[128];
else if(strcmp (cmd,"/roubar",true) ==0);
{
if(!IsPlayerInRangeOfPoint(playerid ,30,30, 1435.23, -981.54, 983.65 )) return SendClientMessage(playerid , COLOR_PING , "Voce Nao Esta no Cofre Banco /cofrebanco que estara Perto da Porta Azul");
if(IsPLayerInRangeOfPoint(playerid , 30 , 30, 1435.23, -981.54, 983.65 ))
{
new stringa[259];
new sendernome [MAX_PLAYER_NOME];
GetPlayerNome(playerid, sendername, sizeof(sendername));
formet(stringa,sizeof(stringa), "**%s esta Roubando o Banco **", sendername);
ProxDetector(15.0, playerid , stringa , COLOR_RED , COLOR_RED ,COLOR_RED , COLOR_RED , COLOR_RED);
SetTimerEx("Robbank" ,6000,0,"i", playerid);
Kils = SetTimerEx ("roubar" ,3500,1,"i",playerid);
ApplyAnimation(playerid, "ROB_BANK","CAT_Safe_Open_O" ,3.0,0,0,0,0,0);
robmoney[playerid] =random(15000);
}
return 1;
}

public roubar(playerid)
{
ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Open_O",3.0,0,0,0,0,0);
}

public Robbank(playerid)
{
SendClientMessage(playerid, COLOR_PINK, "Voce Roubou o Banco Agora Fuga, Para Nao ser Preso!!");
KillTimer(Kils);
ClearAnimations(playerid);
GivePlayerMoney(playerid, robmoney[playerid]);
return 1;
}




return 1;
}

public OnFilterScriptExit ()
{
        return 1;
}

Qual o sentido desse else if? Apague ele.

retirei e deu esse erro 
Código:
: error 036: empty statement
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(16) : error 017: undefined symbol "playerid"
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(16) : error 017: undefined symbol "playerid"
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(17) : error 017: undefined symbol "IsPLayerInRangeOfPoint"
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(20) : error 017: undefined symbol "MAX_PLAYER_NOME"
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(20) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(20) : error 036: empty statement
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(20) : fatal error 107: too many error messages on one line
codigo
Código:
public OnPlayerCommandText  ()
{
new cmd[128];
if(strcmp (cmd,"/roubar",true) ==0);
{
if(!IsPlayerInRangeOfPoint(playerid ,30,30, 1435.23, -981.54, 983.65 )) return SendClientMessage(playerid , COLOR_PING , "Voce Nao Esta no Cofre Banco /cofrebanco que estara Perto da Porta Azul");
if(IsPLayerInRangeOfPoint(playerid , 30 , 30, 1435.23, -981.54, 983.65 ))
{
new stringa[259];
new sendernome [MAX_PLAYER_NOME];
GetPlayerNome(playerid, sendername, sizeof(sendername));
formet(stringa,sizeof(stringa), "**%s esta Roubando o Banco **", sendername);
ProxDetector(15.0, playerid , stringa , COLOR_RED , COLOR_RED ,COLOR_RED , COLOR_RED , COLOR_RED);
SetTimerEx("Robbank" ,6000,0,"i", playerid);
Kils = SetTimerEx ("roubar" ,3500,1,"i",playerid);
ApplyAnimation(playerid, "ROB_BANK","CAT_Safe_Open_O" ,3.0,0,0,0,0,0);
robmoney[playerid] =random(15000);
}
return 1;



RE: C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pw - xbruno1000x - 28/07/2021

preste atenção ao digitar seu código. Existiam diversos erros como "Nome" ao invés de "Name". Lembre-se que os códigos nativos estão em inglês, então expressões em PT-BR não funcionarão.

Também faltavam stocks e news no seu código, além de um else perdido.
tente assim:
Código:
#include <a_samp>
#include <Streamer>
#include <sscanf2>
#include <foreach>

#define COLOR_PINK 0xFF66FFAA
#define COLOR_RED 0xF60000AA

forward roubar(playerid);
forward Robbank(playerid);

new robmoney[MAX_PLAYERS];
new Kils;

public OnPlayerCommandText(playerid)
{
    new cmd[128];
    if(strcmp (cmd,"/roubar",true) == 0)
    {
        if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1435.23, -981.54, 983.65)) return SendClientMessage(playerid , COLOR_PINK, "Voce Nao Esta no Cofre Banco /cofrebanco que estara Perto da Porta Azul");

        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1435.23, -981.54, 983.65))
        {
            new rand = random(15000);
            new stringa[259];
            new sendername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(stringa,sizeof(stringa), "**%s esta Roubando o Banco **", sendername);
            ProxDetector(15.0, playerid , stringa , COLOR_RED , COLOR_RED ,COLOR_RED , COLOR_RED , COLOR_RED);
            SetTimerEx("Robbank" ,6000,0,"i", playerid);
            Kils = SetTimerEx ("roubar" , 3500, 1, "i", playerid);
            ApplyAnimation(playerid, "ROB_BANK", "CAT_Safe_Open_O", 3.0, 0, 0, 0, 0, 0);
            robmoney[playerid] = rand;
        }
    }
    return 1;
}

public roubar(playerid)
{
    ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Open_O",3.0,0,0,0,0,0);
}

public Robbank(playerid)
{
    SendClientMessage(playerid, COLOR_PINK, "Voce Roubou o Banco Agora Fuga, Para Nao ser Preso!!");
    KillTimer(Kils);
    ClearAnimations(playerid);
    GivePlayerMoney(playerid, robmoney[playerid]);
    return 1;
}

forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        foreach(new i: Player)
        {
            if(IsPlayerConnected(i))
            {
                if(!BigEar[i])
                {
                    GetPlayerPos(i, posx, posy, posz);
                    tempposx = (oldposx -posx);
                    tempposy = (oldposy -posy);
                    tempposz = (oldposz -posz);
                    if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                    {
                        SendClientMessage(i, col1, string);
                    }
                    else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                    {
                        SendClientMessage(i, col2, string);
                    }
                    else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                    {
                        SendClientMessage(i, col3, string);
                    }
                    else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                    {
                        SendClientMessage(i, col4, string);
                    }
                    else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                    {
                        SendClientMessage(i, col5, string);
                    }
                }
                else
                {
                    SendClientMessage(i, col1, string);
                }
            }
        }
    }
    return 1;
}



RE: C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pw - J.E - 28/07/2021

(28/07/2021 12:43)xbruno1000x Escreveu: preste atenção ao digitar seu código. Existiam diversos erros como "Nome" ao invés de "Name". Lembre-se que os códigos nativos estão em inglês, então expressões em PT-BR não funcionarão.

Também faltavam stocks e news no seu código, além de um else perdido.
tente assim:
Código:
#include <a_samp>
#include <Streamer>
#include <sscanf2>
#include <foreach>

#define COLOR_PINK 0xFF66FFAA
#define COLOR_RED 0xF60000AA

forward roubar(playerid);
forward Robbank(playerid);

new robmoney[MAX_PLAYERS];
new Kils;

public OnPlayerCommandText(playerid)
{
    new cmd[128];
    if(strcmp (cmd,"/roubar",true) == 0)
    {
        if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1435.23, -981.54, 983.65)) return SendClientMessage(playerid , COLOR_PINK, "Voce Nao Esta no Cofre Banco /cofrebanco que estara Perto da Porta Azul");

        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1435.23, -981.54, 983.65))
        {
            new rand = random(15000);
            new stringa[259];
            new sendername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(stringa,sizeof(stringa), "**%s esta Roubando o Banco **", sendername);
            ProxDetector(15.0, playerid , stringa , COLOR_RED , COLOR_RED ,COLOR_RED , COLOR_RED , COLOR_RED);
            SetTimerEx("Robbank" ,6000,0,"i", playerid);
            Kils = SetTimerEx ("roubar" , 3500, 1, "i", playerid);
            ApplyAnimation(playerid, "ROB_BANK", "CAT_Safe_Open_O", 3.0, 0, 0, 0, 0, 0);
            robmoney[playerid] = rand;
        }
    }
    return 1;
}

public roubar(playerid)
{
    ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Open_O",3.0,0,0,0,0,0);
}

public Robbank(playerid)
{
    SendClientMessage(playerid, COLOR_PINK, "Voce Roubou o Banco Agora Fuga, Para Nao ser Preso!!");
    KillTimer(Kils);
    ClearAnimations(playerid);
    GivePlayerMoney(playerid, robmoney[playerid]);
    return 1;
}

forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        foreach(new i: Player)
        {
            if(IsPlayerConnected(i))
            {
                if(!BigEar[i])
                {
                    GetPlayerPos(i, posx, posy, posz);
                    tempposx = (oldposx -posx);
                    tempposy = (oldposy -posy);
                    tempposz = (oldposz -posz);
                    if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                    {
                        SendClientMessage(i, col1, string);
                    }
                    else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                    {
                        SendClientMessage(i, col2, string);
                    }
                    else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                    {
                        SendClientMessage(i, col3, string);
                    }
                    else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                    {
                        SendClientMessage(i, col4, string);
                    }
                    else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                    {
                        SendClientMessage(i, col5, string);
                    }
                }
                else
                {
                    SendClientMessage(i, col1, string);
                }
            }
        }
    }
    return 1;
}
eu coloquei oq vc mandou e deu isso
Código:
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(66) : error 017: undefined symbol "BigEar"
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(66) : warning 215: expression has no effect
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(66) : error 001: expected token: ";", but found "]"
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(66) : error 029: invalid expression, assumed zero
C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pwn(66) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase



RE: C:\Users\Administrator\Desktop\GM Roleplay - Dominio SAMP\filterscripts\roubobanco.pw - xbruno1000x - 28/07/2021

Faltou um new BigEar[MAX_PLAYERS]; no topo do gamemode.