[Ajuda] Code com um warning satanico
#1

Ajude-me

Код:
//==============================================================================

public OnPlayerUpdate(playerid)
{
    new string[32];
    if(!IsPlayerConnected(playerid)) return 1;
    if(Vel[playerid] == true)
    {
        GetVehicleHealth(GetPlayerVehicleID(playerid),Vhealth);
        format(string, sizeof(string), "~r~~h~%d ~w~KM/H",GetVehicleSpeed(playerid),floatround(Vhealth));
        TextDrawSetString(Velocimetro,string);
        if(IsPlayerInAnyVehicle(playerid))
        {
            TextDrawShowForPlayer(playerid,Velocimetro);
        }
        else
        {
            TextDrawHideForPlayer(playerid,Velocimetro);
        }
    }
	if(GetPlayerVirtualWorld(playerid) == 0){
	SetPlayerHealth(playerid,99999);
	SetPlayerArmour(playerid,99999);
	}
}
//==============================================================================
Код:
warning 209: function "OnPlayerUpdate" should return a value
Reply
#2

vocк nгo retorno nada na public
PHP код:
public OnPlayerUpdate(playerid)
{
    new 
string[32];
    if(!
IsPlayerConnected(playerid)) return 1;
    if(
Vel[playerid] == true)
    {
        
        
GetVehicleHealth(GetPlayerVehicleID(playerid),Vhealth);
        
format(stringsizeof(string), "~r~~h~%d ~w~KM/H",GetVehicleSpeed(playerid),floatround(Vhealth));
        
TextDrawSetString(Velocimetro,string);
        if(
IsPlayerInAnyVehicle(playerid))
        {
            
            
TextDrawShowForPlayer(playerid,Velocimetro);
        }
        else
        {
            
            
TextDrawHideForPlayer(playerid,Velocimetro);
        }
    }
    if(
GetPlayerVirtualWorld(playerid) == 0){
        
SetPlayerHealth(playerid,99999);
        
SetPlayerArmour(playerid,99999);
    }
    return 
1// Faltava Aqui ;D

Reply
#3

Й sу adicionar o retorno antes da ъltima chave.
PHP код:
return 0x01
Abraзos,
Reply
#4

Vllw <3
Reply
#5

A linha que verifica se o jogador estб offline й desnecessбria, pois a OnPlayerUpdate sу atualiza ao jogador online.

Abraзos,
Reply
#6

Obrigado pela dica
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)