28.09.2012, 18:15
Quote:
Where can I find a autofix for vehicles?
you should be avaiable to type /auftofix or af to enable the command I'll put it in the gamemode file a CMD command |
pawn Код:
#include <a_samp>
#include <zcmd>
new bool: IsAutoRepairEnabledForPlayer[MAX_PLAYERS];
public OnFilterScriptInit() { print("Vehicle Repair by [jS]Thomas loaded"); return 1; }
public OnFilterScriptExit() { print("Vehicle Repair by [jS]Thomas unloaded"); return 1; }
public OnPlayerConnect(playerid)
{
IsAutoRepairEnabledForPlayer[playerid] = false;
return 1;
}
CMD:autofix(playerid,params[])
{
#pragma unused params
if(IsAutoRepairEnabledForPlayer[playerid] == false)
{
IsAutoRepairEnabledForPlayer[playerid] = true;
SendClientMessage(playerid,0xAFAFAFAA,"Auto fix enabled!");
}
else
{
IsAutoRepairEnabledForPlayer[playerid] = false;
SendClientMessage(playerid,0xAFAFAFAA,"Auto fix disabled!");
}
return 1;
}
public OnPlayerUpdate(playerid)
{
if(IsPlayerInAnyVehicle(playerid) && IsAutoRepairEnabledForPlayer[playerid] == true)
{
RepairVehicle(GetPlayerVehicleID(playerid));
}
return 1;
}