[Ajuda] Ajuda com esses erros
#1

pessoal me ajuda ai estou aprendendo e estava criando um comando de equipar e quando estivesse equipado aparecer uma mensagem nгo deixando o player se equipar de novo sу que deu o seguinte erro:

C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(202) : error 010: invalid function or declaration
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(442) : error 029: invalid expression, assumed zero
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(442) : error 004: function "OnPlayerEnterVehicle" is not implemented
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(447) : warning 225: unreachable code
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(447) : error 029: invalid expression, assumed zero
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(447) : error 004: function "OnPlayerExitVehicle" is not implemented
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(452) : warning 225: unreachable code
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(452) : error 029: invalid expression, assumed zero
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(452) : error 004: function "OnPlayerStateChange" is not implemented
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(457) : warning 225: unreachable code
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(457) : error 029: invalid expression, assumed zero
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(457) : error 004: function "OnPlayerEnterCheckpoint" is not implemented
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(462) : warning 225: unreachable code
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(462) : error 029: invalid expression, assumed zero
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(462) : error 004: function "OnPlayerLeaveCheckpoint" is not implemented
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(467) : warning 225: unreachable code
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(467) : error 029: invalid expression, assumed zero
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(467) : error 004: function "OnPlayerEnterRaceCheckpoint" is not implemented
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(472) : warning 225: unreachable code
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(472) : error 029: invalid expression, assumed zero
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(472) : error 004: function "OnPlayerLeaveRaceCheckpoint" is not implemented
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(477) : warning 225: unreachable code
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(477) : error 029: invalid expression, assumed zero
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(477) : error 004: function "OnRconCommand" is not implemented
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(482) : warning 225: unreachable code
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(482) : error 029: invalid expression, assumed zero
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(482) : error 004: function "OnPlayerRequestSpawn" is not implemented
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(487) : warning 225: unreachable code
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(487) : error 029: invalid expression, assumed zero
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(487) : error 004: function "OnObjectMoved" is not implemented
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(492) : warning 225: unreachable code
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(492) : error 029: invalid expression, assumed zero
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(492) : error 004: function "OnPlayerObjectMoved" is not implemented
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(497) : warning 225: unreachable code
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(497) : error 029: invalid expression, assumed zero
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(497) : error 004: function "OnPlayerPickUpPickup" is not implemented
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(502) : warning 225: unreachable code
C:\Users\Win7\Desktop\Iniciante\gamemodes\aprenden do.pwn(502) : error 029: invalid expression, assumed zero


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


26 Errors.


Comando:

if (strcmp(cmdtext, "/equipar", true)==0)
{
if(equipado[playerid] ==1) {
SendClientMessage(playerid, Vermelho, "Vc jб se equipou");
}else{
SendClientMessage(playerid, Verde, "Equipado com Sucesso!");
GivePlayerWeapon(playerid, 14, 65);
equipado[playerid] = 1;
return 1;

}

OBS: eu defini a variavel la no topo do gm (new equipado[MAX_PLAYERS] = 0
Reply
#2

O uso correto da variбvel й:
Quote:

new equipado[MAX_PLAYERS];

Pois automaticamente o valor dela й 0, portanto, vc jб estб definindo um valor a ela sendo q n hб necessidade.

@edit

Recomendo usar bool para esse tipo de funзгo, pois vc n vai atribuir valores diferentes de 0 e 1. Faзa assim:

Quote:

new bool:equipado[MAX_PLAYERS];

PHP код:
if (strcmp(cmdtext"/equipar"true)==0)
{
if(
equipado[playerid] == true) {
SendClientMessage(playeridVermelho"Vc jб se equipou");
}else{
SendClientMessage(playeridVerde"Equipado com Sucesso!");
GivePlayerWeapon(playerid1465);
equipado[playerid] = true;
return 
1;

Reply
#3

Certifique-se de que a include a_samp estб definida no topo do GM e, caso esteja, jogue seu cуdigo no tabulador do IpsBruno para ter certeza que todos os brackets estгo fechados. (https://sampforum.blast.hk/showthread.php?tid=361455)

Em relaзгo ao cуdigo, tente desta forma:

Код:
if(strcmp(cmdtext, "/equipar", true) ==0)
{
    if(equipado[playerid] ==1) return SendClientMessage(playerid,Vermelho,"ERRO: Vocк jб se equipou");
    SendClientMessage(playerid, Verde, "Equipado com Sucesso!");
    GivePlayerWeapon(playerid, 14, 65);
    equipado[playerid] = 1;
    return 1;

}
Porйm este comando sу serб usado uma vez, visto que utilizado o comando /equipar ele setarб equipado para 1, assim nгo podendo utiliza-lo outras vezes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)