SA-MP Forums Archive
OnVehicleDamageStatusUpdate help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnVehicleDamageStatusUpdate help! (/showthread.php?tid=597605)



OnVehicleDamageStatusUpdate help! - N0FeaR - 02.01.2016

I get this!
Код:
./includes/callbacks.pwn(6792) : warning 202: number of arguments does not match definition
./includes/callbacks.pwn(6798) : error 017: undefined symbol "Panel"
./includes/callbacks.pwn(6798) : error 001: expected token: ";", but found "]"
./includes/callbacks.pwn(6798) : error 029: invalid expression, assumed zero
./includes/callbacks.pwn(6798) : fatal error 107: too many error messages on one line
PHP код:
public OnVehicleDamageStatusUpdate(vehicleid,playerid)
{
    new 
panelsdoorslightstiresFloat:speed GetPlayerSpeed(playeridtrue);
    foreach (
Player,i)
    {
        if(
IsPlayerConnected(i) && GetPlayerVehicleID(i) == vehicleid)
        {
            
GetVehicleDamageStatus(GetPlayerVehicleID(playerid),panels,doors,lights,tires);
            if(
PlayerVehicleInfo[GetPlayerVehicleID(playerid)][Panel] != panels || VehicleInfo[GetPlayerVehicleID(playerid)][Doors] != doors)
            {
                if(
speed >= 60.0)
                {
                    new 
Float:health;
                    
GetPlayerHealth(i,health);
                    switch(
GetPVarInt(i"Seatbelt"))
                    {
                        case 
0:
                        {
                            
SetPlayerHealth(i,health-20.0);
                        }
                        case 
1:
                        {
                            
SetPlayerHealth(i,health-1.0);
                        }
                    }
                }
            }
        }
    }
    return 
true;




Re: OnVehicleDamageStatusUpdate help! - Lucky13 - 02.01.2016

Where you have the enum for the PlayerVehicleInfo, add this: Panel


Re: OnVehicleDamageStatusUpdate help! - N0FeaR - 02.01.2016

Quote:
Originally Posted by Lucky13
Посмотреть сообщение
Where you have the enum for the PlayerVehicleInfo, add this: Panel
My bad i forgot that thanks dude


Re: OnVehicleDamageStatusUpdate help! - Lucky13 - 02.01.2016

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
My bad i forgot that thanks dude
No problem!