*** Not a descriptive title - ******.
#1

i need a system like CMD:Fix

i want it like to detect first if player is in any vehice if not then error message

and if in vehicle will get 100 health this will be the feature of TECHNICIAN class can someone do like this for me

+rep will be given
Reply
#2

Assuming you require the technician to be in the car of the person you want to have a fixed car....

Код:
CMD:fix(playerid, params[])
{
	if(IsPlayerInAnyVehicle(playerid))
	{
    	SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
	}
   	return 1;
}
(Sorry about horrid indentation, that happens when posting on here...)

Now all you need to do is probably add an if statement to check if the user is logged in and if the user is a technician. I don't know your variable names so I cannot do that for you.
Reply
#3

Thanks +rep i was just confused how to use IsPlayerInAnyVehicle i thought that variable IsPlayerInVehicle

thats y i had to make this post which is making me look like a noob as i can do thousand better things then this but

stuck in this variable
Reply
#4

PHP код:
CMD:fix(playeridparams[])
{
    new 
vehicleFloat:Health;
    
vehicle GetPlayerVehicleID(playerid);
    
GetVehicleHealth(vehicleHealth);
    
    if(
IsPlayerInAnyVehicle(playerid))
    {
        if(
Health 500.0) return SendClientMessage(playeridCOLOR_RED,"Doesn't need repairing!");
        else
        {
            
SetVehicleHealth(vehicle1000.0);
            
SendClientMessage(playeridCOLOR_GREEN"You fixed your vehicle!");
        }
    }
    else return 
SendClientMessage(playeridCOLOR_RED"You need to be in vehicle that you can fix it.");
    return 
1;

Here
Reply
#5

Quote:
Originally Posted by B-Matt
Посмотреть сообщение
PHP код:
CMD:fix(playeridparams[])
{
    new 
vehicleFloat:Health;
    
vehicle GetPlayerVehicleID(playerid);
    
GetVehicleHealth(vehicleHealth);
    
    if(
IsPlayerInAnyVehicle(playerid))
    {
        if(
Health 500.0) return SendClientMessage(playeridCOLOR_RED,"Doesn't need repairing!");
        else
        {
            
SetVehicleHealth(vehicle1000.0);
            
SendClientMessage(playeridCOLOR_GREEN"You fixed your vehicle!");
        }
    }
    else return 
SendClientMessage(playeridCOLOR_RED"You need to be in vehicle that you can fix it.");
    return 
1;

Here
Pffttt.... trying to show me up all fancy status :P Haha just kidding. I just wanted him to work a little :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)