19.08.2012, 10:27
forward InfiniteNitro();
new bool:InSpawn[MAX_PLAYERS];
public OnGameModeInit()
{
SetTimer("InfiniteNitro",2000,1);
return 1;
}
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 0;
}
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,46 3
};
for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++)
{
if(GetVehicleModel(vehicleid) == InvalidNOSVehicles[i]) return false;
}
return true;
}
public OnPlayerSpawn(playerid)
{
InSpawn[playerid] = false;
return 1;
}
how i do the command /buyautoniro to buy the autoniro.
new bool:InSpawn[MAX_PLAYERS];
public OnGameModeInit()
{
SetTimer("InfiniteNitro",2000,1);
return 1;
}
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 0;
}
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,46 3
};
for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++)
{
if(GetVehicleModel(vehicleid) == InvalidNOSVehicles[i]) return false;
}
return true;
}
public OnPlayerSpawn(playerid)
{
InSpawn[playerid] = false;
return 1;
}
how i do the command /buyautoniro to buy the autoniro.