[Ajuda] Erros e mais erros.
#1

pawn Code:
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;
}
pawn Code:
(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
Os Erros se Encontram na Stock que passei.. Alguem por favor me ajude...!
UP!
Reply
#2

Tenta assim.

pawn Code:
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;
}
O seu comando, compilou tranquilo aqui.
Reply
#3

Quote:
Originally Posted by xCR7
View Post
Tenta assim.

pawn Code:
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;
}
O seu comando, compilou tranquilo aqui.
Continua..
Reply
#4

Tente:

pawn Code:
stock IsVehicleInUse(vehicleid)
{
    for(new i; i != MAX_PLAYERS; i++)
    {
        if(GetPlayerVehicleID(i) == vehicleid)
        {
            return i;
        }
    }
    return INVALID_PLAYER_ID;
}
Reply
#5

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:
IsVehicleInUse(vehicleid)
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(GetPlayerVehicleID(i) == vehicleid) return 1;
        if(GetVehicleTrailer(GetPlayerVehicleID(i)) == vehicleid) return 1;
    }
    return 0;
}
Reply
#6

Quote:
Originally Posted by s4kuL
View Post
Tente:

pawn Code:
stock IsVehicleInUse(vehicleid)
{
    for(new i; i != MAX_PLAYERS; i++)
    {
        if(GetPlayerVehicleID(i) == vehicleid)
        {
            return i;
        }
    }
    return INVALID_PLAYER_ID;
}
Funcionou mбs nгo й o ideal, reseta ao contrбrio os carros em uso й resetado.
Quote:
Originally Posted by MultiKill
View Post
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:
IsVehicleInUse(vehicleid)
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(GetPlayerVehicleID(i) == vehicleid) return 1;
        if(GetVehicleTrailer(GetPlayerVehicleID(i)) == vehicleid) return 1;
    }
    return 0;
}
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;
}
EDIT!

Seu Cуdigo Funcionou!! VLW +REP
Reply
#7

PHP Code:
stock IsVehicleInUse(vehicleid)
{
    for(new 
iMAX_PLAYERSi++)
    {
        if(
GetPlayerVehicleID(i) == vehicleid)
            return 
1;
        else if(
GetVehicleTrailer(GetPlayerVehicleID(i)) == vehicleid)
            return 
1;
        else continue;
    }
     return 
0;

Tente assim.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)