/godcar
#1

Can anybody give me a cmd like /godcar (Ladmin) ?
Reply
#2

Quote:
Originally Posted by Millionaire
Посмотреть сообщение
Can anybody give me a cmd like /godcar (Ladmin) ?
PHP код:
YCMD:godcar(playeridparams[], 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(vehicleid99999999.9//random value of assortment
    
return 1;

Recommending for you to switch to YCMD.
Reply
#3

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

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

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

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

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

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)