Posts: 85
Threads: 16
Joined: Dec 2014
Just an small question.
Whats the code to set player invulnerable? (Wont get exploded inside car, Wont get any damage)
Not the
I want instant god mode that you cant get died inside the vehicle exploded.
Thanks in advance
Posts: 366
Threads: 113
Joined: Feb 2014
Set the player health too much high .
PHP код:
SetPlayerHealth(playerid, 100000);
Posts: 85
Threads: 16
Joined: Dec 2014
Quote:
Originally Posted by Arxalan
Set the player health too much high .
PHP код:
SetPlayerHealth(playerid, 100000);
|
Yes i know but it let me exploded / killed inside an vehicle explosion.
Posts: 366
Threads: 113
Joined: Feb 2014
This code is for vehicle.It will don't let the vehicle to explode.
PHP код:
if(IsPlayerInAnyVehicle(i))
{
new Float:hp;
GetVehicleHealth(GetPlayerVehicleID(playerid), hp);
if(hp <= 307.0)
{
RepairVehicle(GetPlayerVehicleID(playerid));
SetVehicleHealth(GetPlayerVehicleID(playerid), 10000.0);
}
}
Posts: 85
Threads: 16
Joined: Dec 2014
Quote:
Originally Posted by Arxalan
This code is for vehicle.It will don't let the vehicle to explode.
PHP код:
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?
Posts: 85
Threads: 16
Joined: Dec 2014
Quote:
Originally Posted by Threshold
pawn Код:
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:
pawn Код:
SetVehicleHealth(vehicleid, Float:0x7F800000);
would work, but I guess you could always try...
|
Thank you so much at your code