SA-MP Forums Archive
[AJUDA] Erros ao copilar uma org - 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] Erros ao copilar uma org (/showthread.php?tid=271993)



[AJUDA] Erros ao copilar uma org - Niko_Bellik - 26.07.2011

Eu estava vendo um tutorial de como criar organizaзхes aqui no forum '' http://forum.sa-mp.com/showthread.ph...ht=sistema+adm '' para colocar no server que estou criando, sу que ao copilar aparece os seguintes erros:

Variavel criada: new VPMilitar[5];

C:\Users\Felipe\Documents\SERVER SAMP\gamemodes\BRASILRPG.pwn(91) : error 017: undefined symbol "VPMilitar"
C:\Users\Felipe\Documents\SERVER SAMP\gamemodes\BRASILRPG.pwn(91) : warning 215: expression has no effect
C:\Users\Felipe\Documents\SERVER SAMP\gamemodes\BRASILRPG.pwn(91) : error 001: expected token: ";", but found "]"
C:\Users\Felipe\Documents\SERVER SAMP\gamemodes\BRASILRPG.pwn(91) : error 029: invalid expression, assumed zero
C:\Users\Felipe\Documents\SERVER SAMP\gamemodes\BRASILRPG.pwn(91) : fatal error 107: too many error messages on one line

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


4 Errors.

Linha 91:

VPMilitar[0] = AddStaticVehicleEx(523,1602.23535156,-1684.06750488,5.55100250,90.00000000,-1,-1,15); //HPV1000

E se eu retiro o '' VPMilitar '' aparece outro erro:

C:\Users\Felipe\Documents\SERVER SAMP\gamemodes\BRASILRPG.pwn(342) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Felipe\Documents\SERVER SAMP\gamemodes\BRASILRPG.pwn(342) : error 017: undefined symbol "strtok"
C:\Users\Felipe\Documents\SERVER SAMP\gamemodes\BRASILRPG.pwn(342) : error 033: array must be indexed (variable "tmp")
C:\Users\Felipe\Documents\SERVER SAMP\gamemodes\BRASILRPG.pwn(342) : fatal error 107: too many error messages on one line

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


4 Errors.

Linha 342:

tmp = strtok(cmd, idx);

Comando:

if(strcmp(cmdtext, "/convidar", true) == 0)
{
new tmp[128]
tmp = strtok(cmd, idx);
new PlayerB;
if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /convidar [id]");
PlayerB = strval(tmp);
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
if(PlayerInfo[playerid][PMilitar] >= 6)
{
PlayerInfo[PlayerB][PMilitar] = 1;
SendClientMessage(PlayerB, Branco, "Vocк entrou а Polнcia Militar");
SetPlayerColor(PlayerB, Cor_PMilitar);
return 1;

_________________________

Alguem pode dar uma ajuda nisso? '-'


Re: [AJUDA] Erros ao copilar uma org - RebeloX - 26.07.2011

Olб, vocк adicionou isto no topo do gm.
pawn Код:
new VPMilitar[Numero de veiculos]
ex:
pawn Код:
new VPMilitar[5]
nгo se esqueзa que quando vocк adicionar os veiculos deve comeзar por 0 e acabar um numero antes do que escolheu, neste caso seria 4.

o outro erro suponho que vocк nгo tenha criado uma strock, algo assim.


Re: [AJUDA] Erros ao copilar uma org - Leeo_Perez - 26.07.2011

niko, vc definiu os veiculos no topo do gamemode? pode ser isso

coloca assim, VPmilitar[5]; (o 5 й um exemplo ponha quanto vocк quiser...)


Re: [AJUDA] Erros ao copilar uma org - RockFire - 26.07.2011

Quote:
Originally Posted by Leeo_Perez
Посмотреть сообщение
niko, vc definiu os veiculos no topo do gamemode? pode ser isso

coloca assim, VPmilitar[5]; (o 5 й um exemplo ponha quanto vocк quiser...)
Errado, 5 й o numero de coisas que ele irб definir, isto й uma array

PHP код:
VPmilitar[0] = CreateVehicle(...);
VPmilitar[1] = CreateVehicle(...);
VPmilitar[2] = CreateVehicle(...);
VPmilitar[3] = CreateVehicle(...);
VPmilitar[4] = CreateVehicle(...); 



Re: [AJUDA] Erros ao copilar uma org - Leeo_Perez - 26.07.2011

entгo,isso que eu quis dizer, se ele definir 5, ele vai ter que por 5 de qualquer jeito


Re: [AJUDA] Erros ao copilar uma org - RockFire - 26.07.2011

Quote:
Originally Posted by Leeo_Perez
Посмотреть сообщение
niko, vc definiu os veiculos no topo do gamemode? pode ser isso

coloca assim, VPmilitar[5]; (o 5 й um exemplo ponha quanto vocк quiser...)
....


Re: [AJUDA] Erros ao copilar uma org - Leeo_Perez - 26.07.2011

ah, deixa vc nao entendeu o que eu quis dizer...


Re: [AJUDA] Erros ao copilar uma org - Niko_Bellik - 26.07.2011

Sim, jб tinha definido o nъmero de veiculos no topo do gm ficando assim..
Код:
new VPmilitar[5];
@Edit: Erro citado acima resolvido, tinha colocado na linha errado e nem tinha percebido.

Agora quero saber como resolver o segundo erro.. '-'


Re: [AJUDA] Erros ao copilar uma org - Leeo_Perez - 26.07.2011

new tmp[128]

altera esse valor pra new tmp[256] ou algo maior sei lб, pode funcionar!


Re: [AJUDA] Erros ao copilar uma org - Shadoww5 - 27.07.2011

Nesta linha, new tmp[128] falta um ponto-e-virgula. A linha deve ficar assim:

PHP код:
new tmp[128];