Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*==============================================================================
- |Credits|
- =========
- This Fs Is Scripted By Me On 2:41 AM 3/7/2014
- Please Dont Remove Credits and if you want to remove them ask for permission
- from me or else dont remove them.
- And Thanks Also To the samp team(Developers-Beta Testers) and all who made Sa:mp
- come to us.
- ================================================================================
- |Defines & Includes|
- ==============================================================================*/
- #define FILTERSCRIPT
- #include <a_samp>
- #if defined FILTERSCRIPT
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xAA3333AA
- /*==============================================================================
- |Forwards & News|
- ==============================================================================*/
- forward AutoFix();
- new AutoRepair[MAX_PLAYERS];
- //============================================================================//
- public OnFilterScriptInit()
- {
- SetTimer("AutoFix", 500, 1);
- print("\n--------------------------------------");
- print(" Auto Car Fix Filterscript By Youssef Ehab Loaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" Auto Car Fix Filterscript By Youssef Ehab Unloaded");
- print("--------------------------------------\n");
- return 1;
- }
- #else
- main()
- {
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- AutoRepair[playerid] = false;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/autofix", cmdtext, true, 20) == 0)
- {
- if(AutoRepair[playerid])
- {
- AutoRepair[playerid] = false;
- SendClientMessage(playerid, COLOR_RED, "You Have Turned Off Your Car's Auto Repair!");
- }
- else
- {
- AutoRepair[playerid] = true;
- SendClientMessage(playerid, COLOR_GREEN, "You Have Turned On Your Car's Auto Repair!");
- }
- return 1;
- }
- return 1;
- }
- public AutoFix()
- {
- for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
- {
- if(IsPlayerConnected(playerid))
- {
- if(!AutoRepair[playerid]) return 0;
- new Float:health, vehicleid;
- if (IsPlayerInAnyVehicle(playerid))
- {
- vehicleid = GetPlayerVehicleID(playerid);
- GetVehicleHealth(vehicleid, health);
- if (health < 999)
- {
- RepairVehicle(GetPlayerVehicleID(playerid));
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement