PDA

View Full Version : Small Help


S4MSUNG
22/01/2015, 11:00 AM
Just an small question.

Whats the code to set player invulnerable? (Wont get exploded inside car, Wont get any damage)

Not the SetPlayerHealth

I want instant god mode that you cant get died inside the vehicle exploded.

Thanks in advance

Arxalan
22/01/2015, 11:07 AM
Set the player health too much high .
SetPlayerHealth(playerid, 100000);

S4MSUNG
22/01/2015, 11:12 AM
Set the player health too much high .
SetPlayerHealth(playerid, 100000);

Yes i know but it let me exploded / killed inside an vehicle explosion.

Arxalan
22/01/2015, 11:31 AM
This code is for vehicle.It will don't let the vehicle to explode.
if(IsPlayerInAnyVehicle(i))
{
new Float:hp;
GetVehicleHealth(GetPlayerVehicleID(playerid), hp);
if(hp <= 307.0)
{
RepairVehicle(GetPlayerVehicleID(playerid));
SetVehicleHealth(GetPlayerVehicleID(playerid), 10000.0);
}
}

S4MSUNG
22/01/2015, 11:36 AM
This code is for vehicle.It will don't let the vehicle to explode.
if(IsPlayerInAnyVehicle(i))
{
new Float:hp;
GetVehicleHealth(GetPlayerVehicleID(playerid), hp);
if(hp <= 307.0)
{
RepairVehicle(GetPlayerVehicleID(playerid));
SetVehicleHealth(GetPlayerVehicleID(playerid), 10000.0);
}
}

OKay thanks but i have another idea.

Whats the code if admin on duty died then get respawned / revived fast on its position

Like on this:
- Admin Died
- Will get admin last position where he died
- Will respawn asap where he died

How?

Threshold
22/01/2015, 11:36 AM
SetPlayerHealth(playerid, Float:0x7F800000);
That will make the player invulnerable, however I don't think you can prevent deaths from exploding vehicles. It's a native GTA thing :l

The only thing you can really do is keep repairing the vehicle as it takes damage... I don't know if:
SetVehicleHealth(vehicleid, Float:0x7F800000);
would work, but I guess you could always try...

S4MSUNG
22/01/2015, 11:47 AM
SetPlayerHealth(playerid, Float:0x7F800000);
That will make the player invulnerable, however I don't think you can prevent deaths from exploding vehicles. It's a native GTA thing :l

The only thing you can really do is keep repairing the vehicle as it takes damage... I don't know if:
SetVehicleHealth(vehicleid, Float:0x7F800000);
would work, but I guess you could always try...

Thank you so much at your code :)