The vehicle can be repaired every 60 seconds. Help!
#1

Код:
#define FILTERSCRIPT
#define COLOR_LIGHTBLUE 0x0080FFFF
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define IsPlayerNotInVehicle(%0) (!IsPlayerInAnyVehicle(%0))
#include <a_samp>
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Car Fix by pressing 2 to fix your car.");
	print("--------------------------------------\n");

	return 1;

}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
		if(PRESSED(KEY_SUBMISSION))
		{
		new vehicleid = GetPlayerVehicleID(playerid);
		if(IsPlayerInVehicle(playerid, vehicleid))
		{
		SetVehicleHealth(vehicleid,1000.0);
		RepairVehicle(GetPlayerVehicleID(playerid));
	    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have successfully repaired your car!");
		}
		}
		if(PRESSED(KEY_ACTION))
		{
		if(IsPlayerNotInVehicle(playerid))
		{
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have to be in a car to be able to repair your car!");
		}
		}
}
#endif
or

Код:
#include <a_samp>

#define CZERWONY 0xFF0000FF
#define ZIELONY 0x00FF00FF

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SUBMISSION && IsPlayerInAnyVehicle(playerid))
	{
	new currentveh; // flip
    	new Float:angle; // flip
    	currentveh = GetPlayerVehicleID(playerid); // flip
    	GetVehicleZAngle(currentveh, angle); // flip
    	SetVehicleZAngle(currentveh, angle); // flip
        SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0); 
	RepairVehicle(GetPlayerVehicleID(playerid)); 
      	PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
	return 1;
	}

	return 1;
}
This is not mine scripts. I found it from this forum. I wonder how to be able to repair the car every 60 seconds? I know about SetTimer and SetTimerEx, but I do not have sufficient knowledge to use this information. So I ask for your help, please. How to do this?

PS: Sorry for my English, but I'm not from English-speaking country.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)