[HELP]Need help about hotkeys and instant repair.......plz HELP
#1

i have a GM which uses /fix to repair the vehicle but just set the vehicle health to 100 but not the whole vehicle body to 100 ,......
like if the vehicle is on fire than if you type /fix the fire goes off but the vehicle's body stay all scratched and broken.............you guys know what i mean so can anyone help me to make a hotkey like no. 2 to make the vehicle all new...........with all new body.............
plz help.......guys...
Reply
#2

use SetVehicleHealth instead of RepairVehicle
Reply
#3

Quote:
Originally Posted by Sinner
Посмотреть сообщение
use SetVehicleHealth instead of RepairVehicle
ya i am using the same.................

// ------ fix -----------------------------------------------------------------
dcmd_fix(playerid, params[]) {
#pragma unused params
if(IsPlayerInAnyVehicle(playerid)) {
SetVehicleHealth(GetPlayerVehicleID(playerid),1000 .0);
SendClientMessageLang(playerid, COLOR_ORANGE,"Vehicle fixed.","Pojazd naprawiony.");
}
else
{
SendClientMessageLang(playerid, COLOR_WARN,"You must be in vehicle!","Musisz byж w pojeџdzie!");
}
return 1;
}
dcmd_repair(playerid, params[]) { dcmd_fix(playerid, params); return 1; }




and also help in making of the hotkey.........plz
Reply
#4

On top of script write:
PHP код:
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) 
Then:
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
PRESSED(KEY_SUBMISSION))
    {
        new 
id GetPlayerVehicleID(playerid);
        if(
id)
        {
            
SetVehicleHealth(id1000);
            
SendClientMessage(playerid0x00FF00"Vehicle Repaired!");
        }
    }
    return 
1;

This will fix the car whenever the player pressed the "KEY_SUBMISSION" (which is '2' or '+' by default)
Reply
#5

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_SUBMISSION))
    {
            new id = GetPlayerVehicleID(playerid);
            RepairVehicle(id);
            SendClientMessage(playerid, 0x00FF00AA, "Vehicle Repaired!");
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by xerox8521
Посмотреть сообщение
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_SUBMISSION))
    {
            new id = GetPlayerVehicleID(playerid);
            RepairVehicle(id);
            SendClientMessage(playerid, 0x00FF00AA, "Vehicle Repaired!");
    }
    return 1;
}
nah itz not working it shows the pawn not working properly and shows me the dialog with send or dont send one............... guys help me out..............
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)