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;
}
(1584) : error 001: expected token: "-identifier-", but found ";"
(1588) : error 029: invalid expression, assumed zero
(1588) : warning 217: loose indentation
(1588) : warning 215: expression has no effect
(1589) : warning 217: loose indentation
(1590) : error 029: invalid expression, assumed zero
(1590) : warning 217: loose indentation
(1590) : warning 215: expression has no effect
(1592) : warning 209: function "IsVehicleInUse" should return a value
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;
}
Tenta assim.
pawn Code:
|
stock IsVehicleInUse(vehicleid)
{
for(new i; i != MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == vehicleid)
{
return i;
}
}
return INVALID_PLAYER_ID;
}
IsVehicleInUse(vehicleid)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == vehicleid) return 1;
if(GetVehicleTrailer(GetPlayerVehicleID(i)) == vehicleid) return 1;
}
return 0;
}
Tente:
pawn Code:
|
Mostre como vocк estб usando a funзгo. Caso nгo esteja usando mostre as linhas prуximas da funзгo.
Vocк poderia ter feito assim: pawn Code:
|
CMD:resetarsemuso(playerid, params[])
{
if(APlayerData[playerid][PlayerLevel] >= 3)
{
SendAdminText(playerid, "/restv", params);
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;
}
stock IsVehicleInUse(vehicleid)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == vehicleid)
return 1;
else if(GetVehicleTrailer(GetPlayerVehicleID(i)) == vehicleid)
return 1;
else continue;
}
return 0;
}