SA-MP Forums Archive
[Ajuda] comando respawn 1 Warning. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] comando respawn 1 Warning. (/showthread.php?tid=525812)



comando respawn 1 Warning. - Lucas-Fc - 13.07.2014

To tentando fazer um comando do meu sistema de administraзгo, pra respawnar os carros que nгo estejam ocupados, mais ta dando 1 Warning.

comando :

pawn Код:
command(respawn, playerid, params[])
{
    if( ASystem[playerid][Admin] == true ) { SendClientMessage(playerid, Cinza, "Vocк nгo й um administrador"); }

    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        if(IsVehicleOccupied(i))
        {
            SetVehicleToRespawn(i);
        }
    }
   
    new Str[80]; format(Str, sizeof(Str), "%s Respanou todos os veнculos desocupados", pNome(playerid));
    SendClientMessageToAll(Roxo, Str);
    return 1;
}
stock

pawn Код:
stock IsVehicleOccupied(vehicleid) // Retorna a 1 se hб alguйm no veнculo
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInAnyVehicle(i))
        {
            if(GetPlayerVehicleID(i) == vehicleid)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
    }
}
pawn Код:
C:\Users\Lucas\Desktop\samp03z_svr_R1_win32\Sistemas\Sistema de administraзгo.pwn(305) : warning 209: function "IsVehicleOccupied" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
alguйm sabe pq ta acontecendo isso ? nгo vejo problemas no cуdigo


Re: comando respawn 1 Warning. - Lucas-Fc - 13.07.2014

Galera, fiz assim agora na stock e compilou, mais nгo sei se funcionarб de forma correta.

pawn Код:
stock IsVehicleOccupied(vehicleid) // Retorna a 1 se hб alguйm no veнculo
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInAnyVehicle(i))
        {
            if(GetPlayerVehicleID(i) == vehicleid)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
    }
    return 1;
}



Re: comando respawn 1 Warning. - Lucas-Fc - 13.07.2014

Alguйm ?


Re: comando respawn 1 Warning. - ScripterInicianteBR - 14.07.2014

Olб Lucas ,
atй onde eu sei ( so iniciante tbm ) olha scripter's avanзados jб me falarao que o Warning nгo " AFETA " o GameMode й apenas celulas que alguma linha nгo pode estar alinhada .
ou sejб isso nгo interfere nada .
Warning = Celulas do gm/fs .



Skype : MathHostMH
FB ; www.********.com/MatheusSiqueiraOficial


Re: comando respawn 1 Warning. - Schocc - 14.07.2014

Quote:
Originally Posted by ScripterInicianteBR
Посмотреть сообщение
Olб Lucas ,
atй onde eu sei ( so iniciante tbm ) olha scripter's avanзados jб me falarao que o Warning nгo " AFETA " o GameMode й apenas celulas que alguma linha nгo pode estar alinhada .
ou sejб isso nгo interfere nada .
Warning = Celulas do gm/fs .



Skype : MathHostMH
FB ; www.********.com/MatheusSiqueiraOficial
Warning, como o prуprio nome jб diz sгo "avisos" e sim devem ser analisados, eles nгo geram problemas em tempo de compilaзгo, mas podem apresentar/avisar sobre problemas...


Re: comando respawn 1 Warning. - WLSF - 14.07.2014

Quote:
Originally Posted by Lucas-Fc
Посмотреть сообщение
Alguйm ?
Alguйm pra quк ? tu falou que conseguiu compilar, entгo jб resolveu o problema. '-'


Sу pra atentar, avisos podem gerar problemas na execuзгo do cуdigo sim.


Re: comando respawn 1 Warning. - PT - 14.07.2014

Muda a sua funcao

pawn Код:
stock IsVehicleOccupied(vehicleid) // Retorna a 1 se hб alguйm no veнculo 0 caso esteja sem ninguem
{
    for(new i = 0; i < MAX_PLAYERS; i++)
        if(IsPlayerInAnyVehicle(i) && GetPlayerVehicleID(i) == vehicleid)
            return 1;
    return 0;
}