SA-MP Forums Archive
[Ajuda]Erro ao Compilar - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda]Erro ao Compilar (/showthread.php?tid=296749)



[Ajuda]Erro ao Compilar - mutante_br - 12.11.2011

Erro:
pawn Код:
G:\BOG\Servidor\gamemodes\BOP.pwn(56998) : error 010: invalid function or declaration
G:\BOG\Servidor\gamemodes\BOP.pwn(56999) : error 010: invalid function or declaration
G:\BOG\Servidor\gamemodes\BOP.pwn(57001) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.

Linha:
pawn Код:
if(vid == admcars[1] || vid == admcars[2] || vid == admcars[3] || vid == admcars[4] || vid == hospcars[5] || vid == hospcars[6] || vid == hospcars[7] || vid == hospcars[8] || vid == hospcars[10] || vid == hospcars[11] || vid == hospcars[12] || vid == hospcars[13] || vid == hospcars[14]){
if(PlayerInfo[playerid][pAdmin] < 1)
SendClientMessage(playerid, Verde, "Bem vindo Administrador.");
} else {
SendClientMessage(playerid, Vermelho, "Vocк nгo й um Administrador");
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
}



Re: [Ajuda]Erro ao Compilar - Pharrel - 12.11.2011

pawn Код:
if((vid >= admcars[1] && vid <= admcars[4]) || (vid >= hospcars[5] && vid <= hospcars[14] && vid != hospcars[9]))
{
    if(PlayerInfo[playerid][pAdmin] > 1)
        SendClientMessage(playerid, Verde, "Bem vindo Administrador.");
    else
    {
        SendClientMessage(playerid, Vermelho, "Vocк nгo й um Administrador");
        RemovePlayerFromVehicle(playerid);
        TogglePlayerControllable(playerid, 1);
    }
}
Cuidado com as chaves...


Re: [Ajuda]Erro ao Compilar - mutante_br - 12.11.2011

eu coloque tu mandou ainda continua msm erro:

pawn Код:
G:\BOG\Servidor\gamemodes\BOP.pwn(56998) : error 010: invalid function or declaration
G:\BOG\Servidor\gamemodes\BOP.pwn(57000) : error 010: invalid function or declaration
G:\BOG\Servidor\gamemodes\BOP.pwn(57002) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.



Re: [Ajuda]Erro ao Compilar - iansinho - 12.11.2011

Isso que dб cуdigo mal identado...
EDIT:

Tenta:
pawn Код:
if(vid == admcars[1] || vid == admcars[2] || vid == admcars[3] || vid == admcars[4] || vid == hospcars[5] || vid == hospcars[6] || vid == hospcars[7] || vid == hospcars[8] || vid == hospcars[10] || vid == hospcars[11] || vid == hospcars[12] || vid == hospcars[13] || vid == hospcars[14])
{
    if(PlayerInfo[playerid][pAdmin] < 1) SendClientMessage(playerid, Verde, "Bem vindo Administrador.");
}
else
{
    SendClientMessage(playerid, Vermelho, "Vocк nгo й um Administrador");
    RemovePlayerFromVehicle(playerid);
    TogglePlayerControllable(playerid, 1);
}



Re: [Ajuda]Erro ao Compilar - Pharrel - 12.11.2011

entao o erro n ta nesse codigo...

posta a new hospcars e a new admcars e a new vid


Re: [Ajuda]Erro ao Compilar - mutante_br - 12.11.2011

ai:
pawn Код:
new admcars[15];
Veiculos:
pawn Код:
admcars[1] = AddStaticVehicleEx(487,-554.21221924,-1031.97814941,24.28796196,238.00000000,126,1,15); //Maverick
admcars[2] = AddStaticVehicleEx(579,-584.14886475,-1068.71765137,23.44242859,236.00000000,126,1,15); //Huntley
admcars[3] = AddStaticVehicleEx(437,-578.10711670,-1064.71362305,23.74684906,234.00000000,126,1,15); //Coach
admcars[4] = AddStaticVehicleEx(522,-575.04290771,-1053.28564453,23.35734940,236.00000000,126,1,15); //NRG-500
admcars[5] = AddStaticVehicleEx(483,-572.34844971,-1050.91125488,23.96123123,234.00000000,126,1,15); //Camper
admcars[6] = AddStaticVehicleEx(429,-586.53552246,-1071.75964355,23.11956978,236.00000000,126,1,15); //Banshee
admcars[7] = AddStaticVehicleEx(506,-564.41015625,-1038.67309570,23.82609177,232.00000000,126,1,15); //Super GT
admcars[8] = AddStaticVehicleEx(541,-566.59954834,-1041.48413086,23.70655441,234.00000000,126,1,15); //Bullet
admcars[9] = AddStaticVehicleEx(555,-570.33398438,-1047.42626953,23.68722916,238.00000000,126,1,15); //Windsor
admcars[10] = AddStaticVehicleEx(487,-599.62457275,-1093.19128418,24.28796196,237.99682617,126,1,15); //Maverick
admcars[11] = AddStaticVehicleEx(522,-576.84948730,-1055.98608398,23.35734940,235.99731445,126,1,15); //NRG-500
admcars[12] = AddStaticVehicleEx(522,-579.07409668,-1059.31030273,23.35734940,235.99731445,126,1,15); //NRG-500
admcars[13] = AddStaticVehicleEx(411,-568.45178223,-1044.71618652,23.71284866,234.00000000,126,1,15); //Infernus
admcars[14] = AddStaticVehicleEx(431,-586.76348877,-1076.31530762,23.81674576,238.00000000,-1,-1,15); //Bus
e esse que mandei pra vcs!


Re: [Ajuda]Erro ao Compilar - Pharrel - 12.11.2011

e a hospcars?


Re: [Ajuda]Erro ao Compilar - AppleX - 12.11.2011

pawn Код:
new vid = GetPlayerVehicleID(playerid);
if(admcars[1] >= vid < admcars[14] || hospcars[5] >= vid < hospcars[14])
{
    if(PlayerInfo[playerid][pAdmin] < 1) SendClientMessage(playerid, Verde, "Bem vindo Administrador.");
}
else
{
    SendClientMessage(playerid, Vermelho, "Vocк nгo й um Administrador");
    RemovePlayerFromVehicle(playerid);
    TogglePlayerControllable(playerid, 1);
}



Re: [Ajuda]Erro ao Compilar - mutante_br - 12.11.2011

eu fiz em outro gm e so usei isso... ¬¬


Re: [Ajuda]Erro ao Compilar - Pharrel - 12.11.2011

Quote:
Originally Posted by AppleX
Посмотреть сообщение
pawn Код:
new vid = GetPlayerVehicleID(playerid);
if(admcars[1] >= vid < admcars[14] || hospcars[5] >= vid < hospcars[14])
{
    if(PlayerInfo[playerid][pAdmin] < 1) SendClientMessage(playerid, Verde, "Bem vindo Administrador.");
}
else
{
    SendClientMessage(playerid, Vermelho, "Vocк nгo й um Administrador");
    RemovePlayerFromVehicle(playerid);
    TogglePlayerControllable(playerid, 1);
}
Desse jeito qq 1 vai poder usar os carros e quando alguem entrar em outro carro qualquer vai ser ejetado e receber a mensagem.

pawn Код:
admcars[1] >= vid < admcars[14]
isso й o mesmo que

pawn Код:
admcars[1] >= vid || vid < admcars[14]
e como da pra perceber com o OR ali em qualquer carro que entrar vai entrar nessa condiзгo.


Tenta assim.
pawn Код:
if(vid >= admcars[1] && vid <= admcars[14])
{
    if(PlayerInfo[playerid][pAdmin] > 1)
        SendClientMessage(playerid, Verde, "Bem vindo Administrador.");
    else
    {
        SendClientMessage(playerid, Vermelho, "Vocк nгo й um Administrador");
        RemovePlayerFromVehicle(playerid);
        TogglePlayerControllable(playerid, 1);
    }
}