Small Help
#1

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
Reply
#2

Set the player health too much high .
PHP код:
SetPlayerHealth(playerid100000); 
Reply
#3

Quote:
Originally Posted by Arxalan
Посмотреть сообщение
Set the player health too much high .
PHP код:
SetPlayerHealth(playerid100000); 
Yes i know but it let me exploded / killed inside an vehicle explosion.
Reply
#4

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);
            }
        } 
Reply
#5

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?
Reply
#6

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...
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)