[AJUDA] Erro
#1

Galera agora apareceu esse erro aki


PHP код:
\testeconce.pwn(271) : error 010invalid function or declaration
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
1 Error

PHP код:
public OnGameModeInit()
{
    
// Don't use these lines if it's a filterscript
    
SetGameModeText("conce");
    
AddPlayerClass(0, -2048.0999, -84.500035.0000269.1425000000);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
SetPlayerCheckpoint(playerid, -2065.2861,-81.7028,35.16413.0);
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp("/comprarbullet"cmdtexttrue10) == 0)
    {
        if(
PlayerToPoint(3.0playerid, -2065.2861,-81.7028,35.1641))
        {
            
ShopCar[playerid] = CreateVehicle(541,-2047.09997559,-84.50000000,35.00000000,0.00000000,-1,-1,15); //Bullet
            
PutPlayerInVehicle(playeridShopCar[playerid], 0);
            
SendClientMessage(playeridCOLOR_GREY"Voce comprou um Bullet");
            }
            else
            {
               
SendClientMessage(playeridCOLOR_GREY"Voce na esta na Concecionaria");
            }
        }
    }
    return 
0;

ou seja o erro foi no retun oq sera que ta faltando ?
Reply
#2

Quote:
Originally Posted by atsbs
Посмотреть сообщение
Galera agora apareceu esse erro aki


PHP код:
\testeconce.pwn(271) : error 010invalid function or declaration
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
1 Error

PHP код:
public OnGameModeInit()
{
    
// Don't use these lines if it's a filterscript
    
SetGameModeText("conce");
    
AddPlayerClass(0, -2048.0999, -84.500035.0000269.1425000000);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
SetPlayerCheckpoint(playerid, -2065.2861,-81.7028,35.16413.0);
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp("/comprarbullet"cmdtexttrue10) == 0)
    {
        if(
PlayerToPoint(3.0playerid, -2065.2861,-81.7028,35.1641))
        {
            
ShopCar[playerid] = CreateVehicle(541,-2047.09997559,-84.50000000,35.00000000,0.00000000,-1,-1,15); //Bullet
            
PutPlayerInVehicle(playeridShopCar[playerid], 0);
            
SendClientMessage(playeridCOLOR_GREY"Voce comprou um Bullet");
            }
            else
            {
               
SendClientMessage(playeridCOLOR_GREY"Voce na esta na Concecionaria");
            }
        }
    }
    return 
0;

ou seja o erro foi no retun oq sera que ta faltando ?
MANDA A LINHA DO ERROR
Reply
#3

Como eu disso o erro e no return

PHP код:
    return 0;

Reply
#4

Tenta assim !!

pawn Код:
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("conce");
    AddPlayerClass(0, -2048.0999, -84.5000, 35.0000, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, -2065.2861,-81.7028,35.1641, 3.0);
    return 1;
}



public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/comprarbullet", cmdtext, true, 10) == 0)
    {
        if(PlayerToPoint(3.0, playerid, -2065.2861,-81.7028,35.1641))
        {
            ShopCar[playerid] = CreateVehicle(541,-2047.09997559,-84.50000000,35.00000000,0.00000000,-1,-1,15); //Bullet
            PutPlayerInVehicle(playerid, ShopCar[playerid], 0);
            SendClientMessage(playerid, COLOR_GREY, "Voce comprou um Bullet");
            }
            else
            {
            SendClientMessage(playerid, COLOR_GREY, "Voce na esta na Concecionaria");
                                       return 1;
            }
        }
    return 1;
    }
    return 0;
}
Reply
#5

Isto deve resolver o seu problema :


Havia algumas chaves a mais no comando /comprarbullet, faltava um return 1; no final do mesmo e o else do cуdigo estava mal posicionado .


Arrumei seu cуdigo:


pawn Код:
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("conce");
    AddPlayerClass(0, -2048.0999, -84.5000, 35.0000, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, -2065.2861,-81.7028,35.1641, 3.0);
    return 1;
}



public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/comprarbullet", cmdtext, true, 10) == 0)
    {
        if(PlayerToPoint(3.0, playerid, -2065.2861,-81.7028,35.1641))
        {
            ShopCar[playerid] = CreateVehicle(541,-2047.09997559,-84.50000000,35.00000000,0.00000000,-1,-1,15); //Bullet
            PutPlayerInVehicle(playerid, ShopCar[playerid], 0);
            SendClientMessage(playerid, COLOR_GREY, "Voce comprou um Bullet");
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "Voce na esta na Concecionaria");
        }
        return 1;
    }
    return 0;
}


Espero ter ajudado .
Reply
#6

continua a msm coisa, msm erro
Reply
#7

pawn Код:
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("conce");
    AddPlayerClass(0, -2048.0999, -84.5000, 35.0000, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, -2065.2861,-81.7028,35.1641, 3.0);
    return 1;
}



public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/comprarbullet", cmdtext, true, 10) == 0)
    {
        if(PlayerToPoint(3.0, playerid, -2065.2861,-81.7028,35.1641))
        {
            ShopCar[playerid] = CreateVehicle(541,-2047.09997559,-84.50000000,35.00000000,0.00000000,-1,-1,15); //Bullet
            PutPlayerInVehicle(playerid, ShopCar[playerid], 0);
            SendClientMessage(playerid, COLOR_GREY, "Voce comprou um Bullet");
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "Voce na esta na Concecionaria");
        }
        return 1;
    }
    return 1;// Sу mudar pra 1 ^^
}
Reply
#8

vlw deu certo
Reply
#9

Galera deu esse warning agr

PHP код:
C:\Users\Antonio\samp host\gamemodes\testeconce.pwn(284) : warning 217loose indentation
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
1 Warning

linhas:

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
new 
ultimocarro[301];
        new 
novocarro GetPlayerVehicleID(playerid);
        new 
carid GetPlayerVehicleID(playerid);
        if(
Testedrive(carid))
        {
                if (
Teste[playerid] != novocarro)
                {
                        
TogglePlayerControllable(playerid0);
                        
GameTextForPlayer(playerid,"~w~Voce pode Fazer um Teste Driver~n~Cost:~g~$Gratis~n~~w~Para Fazer digite ~g~/teste~w~~n~para sair use ~r~/sair"50003);
                }
                
ultimocarro[playerid] = novocarro;
        }
        return 
1;
}
public 
Testedrive(carid)
{
        if(
carid == || carid == 2)
        {
                return 
1;
        }
        return 
0;

@Edit sry o dobler post nem vi mais ajeitei, dei uma olhada e faltou o #pragma tabsize 0
Reply
#10

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
        new ultimocarro[301];
        new novocarro = GetPlayerVehicleID(playerid);
        new carid = GetPlayerVehicleID(playerid);
        if(Testedrive(carid))
        {
                if (Teste[playerid] != novocarro)
                {
                        TogglePlayerControllable(playerid, 0);
                        GameTextForPlayer(playerid,"~w~Voce pode Fazer um Teste Driver~n~Cost:~g~$Gratis~n~~w~Para Fazer digite ~g~/teste~w~~n~para sair use ~r~/sair", 5000, 3);
                }
                ultimocarro[playerid] = novocarro;
        }
        return 1;
}

public Testedrive(carid)
{
        if(carid == 1 || carid == 2)
        {
             return 1;
        }
        return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)