CMD:rc(playerid, params[])
{
SendAdminText(playerid, "/rc", params);
if(APlayerData[playerid][PlayerLevel] >= 1)
{
new bool:vehicle[MAX_VEHICLES];
for(new j = 1; GetVehicleModel(j); ++j)
{
vehicle[j] = false;
for(new i, p = GetMaxPlayers(); i < p; ++i)
{
if(!IsPlayerInAnyVehicle(i) || !IsPlayerConnected(i) )
continue;
if(IsPlayerInVehicle(i, j))
{
vehicle[j] = true;
break;
}
}
if(!vehicle[j])
if(!IsTrailerAttachedToVehicle(j))
SetVehicleToRespawn(j);
}
}
else
return 0;
return 1;
}
AQUI
De uma olhada, la pro final tem a soluзгo que vocк procura . Se funfa da +REP ai |
CMD:rc(playerid, params[])
{
SendAdminText(playerid, "/rc", params);
if(APlayerData[playerid][PlayerLevel] >= 1)
{
new bool:vehicle[MAX_VEHICLES];
for(new j = 1; GetVehicleModel(j); ++j)
{
vehicle[j] = false;
for(new i, p = GetMaxPlayers(); i < p; ++i)
{
if(!IsPlayerInAnyVehicle(i) || !IsPlayerConnected(i) )
continue;
if(IsPlayerInVehicle(i, j) || IsTrailerAttachedToVehicle(i))
{
vehicle[j] = true;
break;
}
}
if(!vehicle[j])
if(!IsTrailerAttachedToVehicle(j))
SetVehicleToRespawn(j);
}
}
else return false;
return true;
}
for(new i, p = GetMaxPlayers(); i < p; ++i)
for(new i = 0; i < MAX_PLAYERS; ++ i)
CMD:rc(playerid, params[])
{
SendAdminText(playerid, "/rc", params);
if(APlayerData[playerid][PlayerLevel] >= 1)
{
new bool:vehicle[MAX_VEHICLES];
for(new j = 1; GetVehicleModel(j); ++j)
{
vehicle[j] = false;
for(new i, p = GetMaxPlayers(); i < p; ++i)
{
if(!IsPlayerInAnyVehicle(i) || !IsPlayerConnected(i) )
continue;
if(IsPlayerInVehicle(i, j))
{
if(vehicle[j] = true && IsTrailerAttachedToVehicle(j) == true)
break;
}
}
if(!vehicle[j])
if(!IsTrailerAttachedToVehicle(j))
SetVehicleToRespawn(j);
else return 0;
}
}
else
return 0;
return 1;
}
CMD:resetarveiculos(playerid, params[])
{
SendAdminText(playerid, "/resetarveiculos", params);
if(APlayerData[playerid][PlayerLevel] < 2) return SendClientMessage(playerid, -1, "{ff0000}Vocк precisa ser admin nivel 2 para usar este comando!");
for(new i; i < MAX_VEHICLES; i++)
if(!IsVehicleInUse(i))
SetVehicleToRespawn(i);
return 1;
}
stock IsVehicleInUse(vehicleid)
{
new Veiculo;
for(new i; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == vehicleid)
Veiculo = vehicleid;
if(GetVehicleTrailer(GetPlayerVehicleID(i)) == vehicleid)
Veiculo = vehicleid;
}
return Veiculo;
}
PHP код:
|