[Ajuda] Argument Type Mismatch (Argument 2)
#1

PHP код:
public OnVehicleDamageStatusUpdate(vehicleidplayerid)
{
    if(
cinto[playerid] == 0)
    {
        if(
GetVehicleHealth(vehicleidVehicleHealth-100// aonde estб dando erro
        
{
            
GetPlayerHealth(playeridVehicleHealth);
            
SetPlayerHealth(playerid,VehicleHealth-0.0001);
            
SendClientMessage(playerid,COLOR_YELLOW,"[Aviso]: Vocк bateu com seu veнculo, e por nгo estar usando o cinto, acabou se machucando.");
        }
        else if(
GetVehicleHealth(vehicleidVehicleHealth+100)  // aonde estб dando erro
        
{
            
GetPlayerHealth(playeridVehicleHealth);
            
SetPlayerHealth(playerid,VehicleHealth-1);
            
SendClientMessage(playerid,COLOR_YELLOW,"[Aviso]: Vocк bateu com seu veнculo, e por nгo estar usando o cinto, acabou se machucando.");
        }
    }
    return 
1;

O quк eu estou tentando fazer pessoal, й que por exemplo:

Se o cara tira-se mais de 100 de vida do veнculo, ele perdia -1 de vida, e se ele bate-se o veнculo e retira-se menos de 100 ele perdia 0.0001

Observaзгo: o VehicleHealth estб definido no topo da GM.
Reply
#2

PHP код:
public OnVehicleDamageStatusUpdate(vehicleidplayerid)  {
    new 
panelsdoorslightstires;
    new 
Float vida;
    
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
    if ( 
cinto[playerid] == ) {
        if ( ( 
panels doors lights tires ) < 100) {
            
GetPlayerHealth(playeridvida); 
            
SetPlayerHealth(playerid, ( vida 0.0001) ); 
            
SendClientMessage(playerid,COLOR_YELLOW,"[Aviso]: Vocк bateu com seu veнculo, e por nгo estar usando o cinto, acabou se machucando."); 
        } 
        else {
            
GetPlayerHealth(playeridvida); 
            
SetPlayerHealth(playerid, ( vida 1.0 ) ); 
            
SendClientMessage(playerid,COLOR_YELLOW,"[Aviso]: Vocк bateu com seu veнculo, e por nгo estar usando o cinto, acabou se machucando."); 
        } 
    } 
    return 
1

**Nгo sei se irб funcionar corretamente.
Reply
#3

Quote:
Originally Posted by Gii
Посмотреть сообщение
PHP код:
public OnVehicleDamageStatusUpdate(vehicleidplayerid)  {
    new 
panelsdoorslightstires;
    new 
Float vida;
    
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
    if ( 
cinto[playerid] == ) {
        if ( ( 
panels doors lights tires ) < 100) {
            
GetPlayerHealth(playeridvida); 
            
SetPlayerHealth(playerid, ( vida 0.0001) ); 
            
SendClientMessage(playerid,COLOR_YELLOW,"[Aviso]: Vocк bateu com seu veнculo, e por nгo estar usando o cinto, acabou se machucando."); 
        } 
        else {
            
GetPlayerHealth(playeridvida); 
            
SetPlayerHealth(playerid, ( vida 1.0 ) ); 
            
SendClientMessage(playerid,COLOR_YELLOW,"[Aviso]: Vocк bateu com seu veнculo, e por nгo estar usando o cinto, acabou se machucando."); 
        } 
    } 
    return 
1

**Nгo sei se irб funcionar corretamente.
Funcionar funcionou, porйm, ele sу estб aparecendo a segunda:

PHP код:
GetPlayerHealth(playeridvida); 
SetPlayerHealth(playerid, ( vida 1.0 ) ); 
SendClientMessage(playerid,COLOR_YELLOW,"[Aviso]: Vocк bateu com seu veнculo, e por nгo estar usando o cinto, acabou se machucando."); 
E quando eu digito /repararveiculo aparece o de cima.

PS: tб dando um negуcio de sscanf warning
Reply
#4

PHP код:
new FloatVeh[MAX_VEHICLES];
stock Hook_SetVehicleHealth(vehicleidFloat:health) {
    
SetVehicleHealth(vehicleidhealth);
    
Veh[vehicleid] = health;
    return 
1;
}
stock Hook_RepairVehicle(vehicleid) {
    
RepairVehicle(vehicleid);
    
Veh[vehicleid] = 1000;
    return 
1;
}
#if defined _ALS_SetVehicleHealth
    #undef SetVehicleHealth
#else
    #define _ALS_SetVehicleHealth
#endif
#define SetVehicleHealth Hook_SetVehicleHealth
#if defined _ALS_RepairVehicle
    #undef RepairVehicle
#else
    #define _ALS_RepairVehicle
#endif
#define RepairVehicle Hook_RepairVehicle
public OnVehicleSpawn(vehicleid) {
    
GetVehicleHealth(vehicleidVeh[vehicleid]);
    return 
1;
}
public 
OnVehicleDamageStatusUpdate(vehicleidplayerid)  { 
    new 
Float:vida
    
GetVehicleHealth(vehicleidvida); 
    if ( 
cinto[playerid] == ) { 
        if ( ( 
Veh[vehicleid] - vida ) < 100.0 ) { 
            
Veh[vehicleid] = vida
            
GetPlayerHealth(playeridvida);  
            
SetPlayerHealth(playerid, ( vida 0.0001) );  
            
SendClientMessage(playerid,COLOR_YELLOW,"[Aviso]: Vocк bateu com seu veнculo, e por nгo estar usando o cinto, acabou se machucando.");  
        }  
        else { 
            
Veh[vehicleid] = vida
            
GetPlayerHealth(playeridvida);  
            
SetPlayerHealth(playerid, ( vida 1.0 ) );  
            
SendClientMessage(playerid,COLOR_YELLOW,"[Aviso]: Vocк bateu com seu veнculo, e por nгo estar usando o cinto, acabou se machucando.");  
        }  
    } 
    return 
1;  

Nгo testei ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)