[Ajuda] Erro na public !
#1

Pessoal criei essa public para mostrar pro passageiro no velocimetro , Motor: On , Motor: OFF
Ai da um erro olhe

erro:

PHP код:
BMG.pwn(39124) : error 025: function heading differs from prototype 
public:

PHP код:
public MotorPet(newstatevehicleidispassenger)
{
 new 
velopet5[128];
 for (new 
i=0i<MAX_PLAYERSi++)
 {
    if(
newstate == PLAYER_STATE_PASSENGER)
    {
            if(
motor[i] == 1)
            {
            
format(velopet5,sizeof(velopet5),"~r~~h~~h~~h~~h~Motor: ~w~Ligado");
            }
            else if(
motor[i] == 0)
            {
            
format(velopet5,sizeof(velopet5),"~r~~h~~h~~h~~h~Motor: ~w~Desligado");
            }
            
TextDrawSetString(MotorOnOFF[i], velopet5);
    }
}

Reply
#2

tenta so assim

pawn Код:
public MotorPet(vehicleid)
{
    new velopet5[128];
    for (new i=0; i<MAX_PLAYERS; i++)
    {
        if(newstate == PLAYER_STATE_PASSENGER)
        {
            if(motor[i] == 1)
            {
                format(velopet5,sizeof(velopet5),"~r~~h~~h~~h~~h~Motor: ~w~Ligado");
            }
            else if(motor[i] == 0)
            {
                format(velopet5,sizeof(velopet5),"~r~~h~~h~~h~~h~Motor: ~w~Desligado");
            }
            TextDrawSetString(MotorOnOFF[i], velopet5);
        }
    }
}
Reply
#3

Quote:
Originally Posted by PT
Посмотреть сообщение
tenta so assim

pawn Код:
public MotorPet(vehicleid)
{
    new velopet5[128];
    for (new i=0; i<MAX_PLAYERS; i++)
    {
        if(newstate == PLAYER_STATE_PASSENGER)
        {
            if(motor[i] == 1)
            {
                format(velopet5,sizeof(velopet5),"~r~~h~~h~~h~~h~Motor: ~w~Ligado");
            }
            else if(motor[i] == 0)
            {
                format(velopet5,sizeof(velopet5),"~r~~h~~h~~h~~h~Motor: ~w~Desligado");
            }
            TextDrawSetString(MotorOnOFF[i], velopet5);
        }
    }
}
deu erro,

PHP код:
C:\Users\PetrickSchoba\Desktop\BRPG\gamemodes\BMG.pwn(39124) : error 025: function heading differs from prototype
C
:\Users\PetrickSchoba\Desktop\BRPG\gamemodes\BMG.pwn(39129) : error 017undefined symbol "newstate"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase 
Reply
#4

1 - Verifique se no seu gm tem a funзгo:

pawn Код:
forward MotorPet(newstate, vehicleid, ispassenger);
E eu acho que vocк nгo precisa cirar uma public sendo qe jб existe uma com essas funзхes:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
Dai dentro dessa public /\ vocк faзa seus cуdigos
Reply
#5

desculpa errei

pawn Код:
forward MotorPet(vehicleid);
public MotorPet(vehicleid)
{
    new velopet5[128];
    for (new i=0; i<MAX_PLAYERS; i++)
    {
        if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
        {
            if(motor[i] == 1)
            {
                format(velopet5,sizeof(velopet5),"~r~~h~~h~~h~~h~Motor: ~w~Ligado");
            }
            else if(motor[i] == 0)
            {
                format(velopet5,sizeof(velopet5),"~r~~h~~h~~h~~h~Motor: ~w~Desligado");
            }
            TextDrawSetString(MotorOnOFF[i], velopet5);
        }
    }
}
Reply
#6

Quote:
Originally Posted by Juniiro3
Посмотреть сообщение
1 - Verifique se no seu gm tem a funзгo:

pawn Код:
forward MotorPet(newstate, vehicleid, ispassenger);
E eu acho que vocк nгo precisa cirar uma public sendo qe jб existe uma com essas funзхes:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
Dai dentro dessa public /\ vocк faзa seus cуdigos
Mais dentro dessa public
PHP код:
public OnPlayerStateChange(playeridnewstateoldstate
Nгo tem
PHP код:
vehicleidispassenger 
Reply
#7

PHP код:
public MotorPet(newstatevehicleidispassenger[]) {
    new 
velopet5[128];
    for (new 
0MAX_PLAYERSi++) {
        if (
newstate == PLAYER_STATE_PASSENGER) {
            if (
motor[i] == 1) {
                
format(velopet5sizeof(velopet5), "~r~~h~~h~~h~~h~Motor: ~w~Ligado");
            } else if (
motor[i] == 0) {
                
format(velopet5sizeof(velopet5), "~r~~h~~h~~h~~h~Motor: ~w~Desligado");
            }
            
TextDrawSetString(MotorOnOFFvelopet5);
        }
    }

Reply
#8

Quote:
Originally Posted by DiiMeNoR
Посмотреть сообщение
PHP код:
public MotorPet(newstatevehicleidispassenger[]) {
    new 
velopet5[128];
    for (new 
0MAX_PLAYERSi++) {
        if (
newstate == PLAYER_STATE_PASSENGER) {
            if (
motor[i] == 1) {
                
format(velopet5sizeof(velopet5), "~r~~h~~h~~h~~h~Motor: ~w~Ligado");
            } else if (
motor[i] == 0) {
                
format(velopet5sizeof(velopet5), "~r~~h~~h~~h~~h~Motor: ~w~Desligado");
            }
            
TextDrawSetString(MotorOnOFFvelopet5);
        }
    }

PHP код:
C:\Users\PetrickSchoba\Desktop\BRPG\gamemodes\BMG.pwn(39122) : error 025: function heading differs from prototype
C
:\Users\PetrickSchoba\Desktop\BRPG\gamemodes\BMG.pwn(39131) : error 035argument type mismatch (argument 1)
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase 
Deu esses erros.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)