/godcar - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /godcar (
/showthread.php?tid=277654)
/godcar -
Millionaire - 18.08.2011
Can anybody give me a cmd like /godcar (Ladmin) ?
Re: /godcar -
Kush - 18.08.2011
Quote:
Originally Posted by Millionaire
Can anybody give me a cmd like /godcar (Ladmin) ?
|
PHP код:
YCMD:godcar(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not authorized to use that command!");
new vehicleid = GetPlayerVehicleID(playerid);
SetVehicleHealth(vehicleid, 99999999.9) //random value of assortment
return 1;
}
Recommending for you to switch to YCMD.
Re: /godcar -
ElieJabbour - 18.08.2011
pawn Код:
CMD:godcar(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an Admin");
{
new vehicleid = GetPlayerVehicleID(playerid);
SetVehicleHealth(vehicleid, 9999999.0);
}
return 1;
}
Re: /godcar -
Kush - 18.08.2011
Quote:
Originally Posted by ElieJabbour
pawn Код:
CMD:godcar(playerid, params[]) { if(!IsPlayerAdmin(playerid)) { SetVehicleHealth(vehicleid, 9999999.0); } return 1; }
|
What if the player is not in a vehicle? This command will not work.
Re: /godcar -
ElieJabbour - 18.08.2011
Quote:
Originally Posted by Kush
What if the player is not in a vehicle? This command will not work.
|
Yep, Forgot to add new vehicleid = GetPlayerVehicleID(playerid);
Edit : Added it now.
Re: /godcar -
Tanush123 - 18.08.2011
Quote:
Originally Posted by ElieJabbour
pawn Код:
CMD:godcar(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an Admin"); { new vehicleid = GetPlayerVehicleID(playerid); SetVehicleHealth(vehicleid, 9999999.0); } return 1; }
|
I recommand u to use timer to make it gets health every second
Re: /godcar -
ElieJabbour - 18.08.2011
Quote:
Originally Posted by Tanush123
I recommand u to use timer to make it gets health every second
|
You do know he can Edit
pawn Код:
SetVehicleHealth(vehicleid, 9999999.0);
, right, he Could set the Car's HP to over 9999999999999 and it needs decades for it to blow -.- ?
Re: /godcar -
Kush - 18.08.2011
Quote:
Originally Posted by Tanush123
I recommand u to use timer to make it gets health every second
|
Las Venturas CNR's method was to differentiate an integer to a float and defined it as a macro. This is the most effective method and timers aren't needed.
Re: /godcar -
ElieJabbour - 18.08.2011
Quote:
Originally Posted by Kush
Las Venturas CNR's method was to differentiate an integer to a float and defined it as a macro. This is the most effective method and timers aren't needed.
|
Indeed, and as i said he could edit the SetVehicleHealth(vehicleid, [Desired HP]) and add it to 999999999+.