... help
#1

im using vehicle godmode but when i use the command (/vehgod) but it doesn't give me infinite health.. help


Код:
CMD:vehgod(playerid,params[])
{
	new vehicleid = GetPlayerVehicleID(playerid);
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"you are not rcon admin");
	if(!IsPlayerInVehicle(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"you are not in vehicle");
	SetVehicleHealth(vehicleid,playerid,99999.99);
	SendClientMessage(playerid,0xFFFFFFF,"Vehicle Godmode Activated");
	return 1;
}
Reply
#2

Code seems good, did you try to do /dl command to check car's health?

Try making it with timers, for ex. each 1 sec system if player is in the car it will set its health to 1000 and then if /vehgod turned off you can kill the timer
Reply
#3

PHP код:
SetVehicleHealth(vehicleid,99999.99); 
Reply
#4

Код:
CMD:vehgod(playerid, params[])
{
	if(IsPlayerInAnyVehicle(playerid))
	{
		GameTextForPlayer(playerid, "~b~~h~~h~~h~Vehicle Godmode Enabled", 5000, 3);
  		SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
  		SetTimerEx("VehGodmode", 500, true, "i", playerid);
		PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
  		return 1;
	}
	SendClientMessage(playerid, -1, "ERROR: You must be in a vehicle to repair.");
	return 1;
}

forward VehGodmode(playerid);
public VehGodmode(playerid);
{
	if(IsPlayerInAnyVehicle(playerid))
	{
  		SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
	}
	SendClientMessage(playerid, -1, "ERROR: You must be in a vehicle to repair.");
	return 1;
}
Reply
#5

Quote:
Originally Posted by SecretBoss
Посмотреть сообщение
Код:
CMD:vehgod(playerid, params[])
{
	if(IsPlayerInAnyVehicle(playerid))
	{
		GameTextForPlayer(playerid, "~b~~h~~h~~h~Vehicle Godmode Enabled", 5000, 3);
  		SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
  		SetTimerEx("VehGodmode", 500, true, "i", playerid);
		PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
  		return 1;
	}
	SendClientMessage(playerid, -1, "ERROR: You must be in a vehicle to repair.");
	return 1;
}

forward VehGodmode(playerid);
public VehGodmode(playerid);
{
	if(IsPlayerInAnyVehicle(playerid))
	{
  		SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
	}
	SendClientMessage(playerid, -1, "ERROR: You must be in a vehicle to repair.");
	return 1;
}
will try that thanks rep+
Reply
#6

Quote:
Originally Posted by ahameed4755
Посмотреть сообщение
will try that thanks rep+
Thanks btw you need to edit some things since I made very fast
Reply
#7

Why would you ever use that?

Just put this piece of define above your script and set the health to the defined alias.

Код:
#if !defined INFINITY
	#define INFINITY (Float:0x7F800000)
#endif

SetVehicleHealth(vehicleid, INFINITY);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)