[Ajuda] Problema com Objetos
#1

Bom, й o seguinte.
Eu editei o Mapa com o programa MapEditor, peguei o cуdigo certinho.
Porйm, na Hora que eu coloco no GM, dб erro na compilaзгo.


Cуdigo em OnPlayerConnect:

PHP код:
{
    
RemoveBuildingForPlayer(playerid59301134.2500, -1338.078123.15630.25);
    
RemoveBuildingForPlayer(playerid57081134.2500, -1338.078123.15630.25);
    
RemoveBuildingForPlayer(playerid6171178.6016, -1332.070312.89060.25);
    
RemoveBuildingForPlayer(playerid6201184.0078, -1353.500012.57810.25);
    
RemoveBuildingForPlayer(playerid6201184.0078, -1343.265612.57810.25);
    
RemoveBuildingForPlayer(playerid6181177.7344, -1315.664113.29690.25);
    
RemoveBuildingForPlayer(playerid6201184.8125, -1292.914112.57810.25);
    
RemoveBuildingForPlayer(playerid6201184.8125, -1303.148412.57810.25);
    return 
1;

O Erro й o seguinte:

C:\Users\Seven\Desktop\Gamemode\gamemodes\GMNOVO.p wn(9886) : error 055: start of function body without function header
C:\Users\Seven\Desktop\Gamemode\gamemodes\GMNOVO.p wn(9895) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.


Grato.
Reply
#2

Editado, Estб errado.
Abraзos...
Reply
#3

Pelo que deu pra entender, tu nгo botou o inicio da callback
pawn Код:
public etc..()
Reply
#4

Quando se coloca Remove, n precisa colocar chave e nen return ( talvez seje isso )
e tbm coloque em OnPlayerConnect
Reply
#5

Quote:
Originally Posted by Samuel300
Посмотреть сообщение
Quando se coloca Remove, n precisa colocar chave e nen return ( talvez seje isso )
e tbm coloque em OnPlayerConnect

Jб tб em "OnPlayerConnect",

Se eu retirar as Chaves "{ , }", dб o seguinte erro:

C:\Users\Seven\Desktop\Gamemode\gamemodes\UL2.pwn( 9886) : error 021: symbol already defined: "RemoveBuildingForPlayer"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#6

dx tipo assim

pawn Код:
{
    RemoveBuildingForPlayer(playerid, 5930, 1134.2500, -1338.0781, 23.1563, 0.25);
    RemoveBuildingForPlayer(playerid, 5708, 1134.2500, -1338.0781, 23.1563, 0.25);
    RemoveBuildingForPlayer(playerid, 617, 1178.6016, -1332.0703, 12.8906, 0.25);
    RemoveBuildingForPlayer(playerid, 620, 1184.0078, -1353.5000, 12.5781, 0.25);
    RemoveBuildingForPlayer(playerid, 620, 1184.0078, -1343.2656, 12.5781, 0.25);
    RemoveBuildingForPlayer(playerid, 618, 1177.7344, -1315.6641, 13.2969, 0.25);
    RemoveBuildingForPlayer(playerid, 620, 1184.8125, -1292.9141, 12.5781, 0.25);
    RemoveBuildingForPlayer(playerid, 620, 1184.8125, -1303.1484, 12.5781, 0.25);
Reply
#7

Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
Pelo que deu pra entender, tu nгo botou o inicio da callback
pawn Код:
public etc..()
Que Public?
em outro Gm, deu certo colocar apenas abaixo de:

public OnPlayerConnect(playerid)
Reply
#8

O codigo aparenta estar fora da OnPlayerConnect.

Estar na OnPlayerConnect eh:

pawn Код:
public OnPlayerConnect(playerid){
// Eu estou na OnPlayerConnect
return 1;
}

{
// Eu nao estou na OnPlayerConnect, sou um codigo solto entao eu darei erros
}
Reply
#9

Quote:
Originally Posted by Kuddy
Посмотреть сообщение
O codigo aparenta estar fora da OnPlayerConnect.

Estar na OnPlayerConnect eh:

pawn Код:
public OnPlayerConnect(playerid){
// Eu estou na OnPlayerConnect
return 1;
}

{
// Eu nao estou na OnPlayerConnect, sou um codigo solto entao eu darei erros
}
Cуdigo:

PHP код:
    RemoveBuildingForPlayer(playerid59301134.2500, -1338.078123.15630.25);
    
RemoveBuildingForPlayer(playerid57081134.2500, -1338.078123.15630.25);
    
RemoveBuildingForPlayer(playerid6171178.6016, -1332.070312.89060.25);
    
RemoveBuildingForPlayer(playerid6201184.0078, -1353.500012.57810.25);
    
RemoveBuildingForPlayer(playerid6201184.0078, -1343.265612.57810.25);
    
RemoveBuildingForPlayer(playerid6181177.7344, -1315.664113.29690.25);
    
RemoveBuildingForPlayer(playerid6201184.8125, -1292.914112.57810.25);
    
RemoveBuildingForPlayer(playerid6201184.8125, -1303.148412.57810.25);
    return 
1;

Erro:

C:\Users\Seven\Desktop\Gamemode\gamemodes\UL2.pwn( 9887) : error 021: symbol already defined: "RemoveBuildingForPlayer"
C:\Users\Seven\Desktop\Gamemode\gamemodes\UL2.pwn( 9895) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#10

Quote:
Originally Posted by Clukin
Посмотреть сообщение
Que Public?
em outro Gm, deu certo colocar apenas abaixo de:

public OnPlayerConnect(playerid)
Quote:
Originally Posted by Clukin
Посмотреть сообщение
Cуdigo:

PHP код:
    RemoveBuildingForPlayer(playerid59301134.2500, -1338.078123.15630.25);
    
RemoveBuildingForPlayer(playerid57081134.2500, -1338.078123.15630.25);
    
RemoveBuildingForPlayer(playerid6171178.6016, -1332.070312.89060.25);
    
RemoveBuildingForPlayer(playerid6201184.0078, -1353.500012.57810.25);
    
RemoveBuildingForPlayer(playerid6201184.0078, -1343.265612.57810.25);
    
RemoveBuildingForPlayer(playerid6181177.7344, -1315.664113.29690.25);
    
RemoveBuildingForPlayer(playerid6201184.8125, -1292.914112.57810.25);
    
RemoveBuildingForPlayer(playerid6201184.8125, -1303.148412.57810.25);
    return 
1;

Erro:

C:\Users\Seven\Desktop\Gamemode\gamemodes\UL2.pwn( 9887) : error 021: symbol already defined: "RemoveBuildingForPlayer"
C:\Users\Seven\Desktop\Gamemode\gamemodes\UL2.pwn( 9895) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Pelo visto vocк tб botando fora da callback sim, preste atenзгo...

pawn Код:
public OnPlayerConnect(playerid)
{
    RemoveBuildingForPlayer(...);
    //Cуdigo
   
    return 1;
}
Aonde tem 'cуdigo' vocк coloca os removeBuilding...
Nгo precisa mais por return nem chave, jб tem os da prуpria funзгo.

Se vocк testou em outro GM e deu certo, o seu erro й estar colocando em qualquer lugar, fora da callback.

Procure por uns tutoriais de programaзгo depois, tб precisando.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)