Key= death?
#1

pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid,playerid)
{
    new Float:health;
    GetPlayerHealth(playerid, health);
    SetPlayerHealth(playerid, health-10);
    return 1;
}
Basicelly when u crash you loce health...But when i press F12 The player dies if in a vehicle! Why? +REP!
Reply
#2

And without this snippet of code the player doesn't die ?
Reply
#3

I'm pretty sure that OnVehicleDamageStatusUpdate doesn't work like that . OnVehicleDamageStatusUpdate is called once a body part of the car is damaged, if you damage multiple parts at once, I'm pretty sure that it will call multiple times.
Reply
#4

Quote:
Originally Posted by aRoach
Посмотреть сообщение
And without this snippet of code the player doesn't die ?
No it doesnt just when you press f12

Althought is there a function to give -10 HP to the player when crashes? More RP...That what i was trying to do...
Reply
#5

Yes you're right, but I've asked if without that snippet it works fine.
It shouldn't because OnVehicleDamageStatusUpdate have nothing to do with the keys...
Reply
#6

Oh, Yes Without the snippet all works fine, Could u post a example if you know about "Lose health when crash" I mean I would like to synch the VehicleHealth with the PlayerHealth ...
Reply
#7

here is my code (get from my LS Reality Roleplay Script)

pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    new Float:health;
    GetPlayerHealth(playerid, health);
    SetPlayerHealth(playerid, health - 2.2);
    return 1;
}
didn't affects my game even i press F12. all works fine
Reply
#8

Quote:
Originally Posted by Gooday
Посмотреть сообщение
Oh, Yes Without the snippet all works fine, Could u post a example if you know about "Lose health when crash" I mean I would like to synch the VehicleHealth with the PlayerHealth ...
You want the player to have the same health value as the car ?

If yes:
pawn Код:
public OnGameModeInit( )
{
    SetTimer( "vSync", 1000, true );
    return 1;
}

forward vSync( );
public vSync( )
{
    for( new i; i < MAX_PLAYERS; i ++ )
    {
        new Float:HP;
        GetVehicleHealth( GetPlayerVehicleID( i ), HP );
        SetPlayerHealth( i, HP / 10 );
    }

    return 1;
}
Reply
#9

Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)