Small 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: Small Help (
/showthread.php?tid=559290)
Small Help -
S4MSUNG - 22.01.2015
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
Re: Small Help -
Arxalan - 22.01.2015
Set the player health too much high .
PHP код:
SetPlayerHealth(playerid, 100000);
Re: Small Help -
S4MSUNG - 22.01.2015
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.
Re: Small Help -
Arxalan - 22.01.2015
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);
}
}
Re: Small Help -
S4MSUNG - 22.01.2015
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?
Re: Small Help -
Threshold - 22.01.2015
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...
Re: Small Help -
S4MSUNG - 22.01.2015
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