Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new AutoFixTimer[MAX_PLAYERS];
- forward InfiniteNitro();
- public OnFilterScriptInit()
- {
- print(" \n-------------------------------------- ");
- print(" Nitro infinito y Autofix iniciando ");
- print(" --------------------------------------\n ");
- SetTimer("InfiniteNitro",1000,1);
- SetTimer("Timer", 1000, true);
- return 1;
- }
- public OnGameModeInit()
- {
- print("Gamemode started!");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp("/autofix", cmdtext, true))
- {
- if(AutoFixTimer[playerid])
- {
- KillTimer(AutoFixTimer[playerid]);
- AutoFixTimer[playerid] = false;
- return SendClientMessage(playerid, 0xFF0000FF, "Autofix desactivado");
- }
- else
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFF00FF, "Necesitas estar en un veh�culo para activar el autofix.");
- AutoFixTimer[playerid] = SetTimerEx("AutoFix", 1000, true, "i", playerid);
- return SendClientMessage(playerid, 0x61D911FF, "Autofix activado.");
- }
- }
- return 0;
- }
- public InfiniteNitro()
- {
- new vehicleid;
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- if(IsPlayerConnected(i))
- {
- if(GetPlayerState(i)==2)
- {
- vehicleid=GetPlayerVehicleID(i);
- if(CheckVehicle(vehicleid))
- AddVehicleComponent(vehicleid,1010);
- }
- }
- }
- return 1;
- }
- stock CheckVehicle(vehicleid)
- {
- #define MAX_INVALID_NOS_VEHICLES 13
- new InvalidNOSVehicles[MAX_INVALID_NOS_VEHICLES] =
- {
- 522,481,441,468,448,446,513,521,510,430,520,476,463 // veh�culos no v�lidos para a�adir autonos
- };
- for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++)
- {
- if(GetVehicleModel(vehicleid) == InvalidNOSVehicles[i]) return false;
- }
- return true;
- }
- forward AutoFix(playerid);
- public AutoFix(playerid)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new vid = GetPlayerVehicleID(playerid), Float:health;
- GetVehicleHealth(vid , health);
- if(health < 500) SetVehicleHealth(vid , 1000.0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment