SA-MP Forums Archive
[Ajuda] Nivel para dirigir veнculo - 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] Nivel para dirigir veнculo (/showthread.php?tid=467681)



Nivel para dirigir veнculo - CrazYou - 04.10.2013

Olб, alguйm pode me ajudar a fazer um sistema para que quando o player entrar em um veнculo, exemplo patriot se ele nгo tiver score 100 ele saia do veнculo automaticamente.


Re: Nivel para dirigir veнculo - ThuuGLif3 - 04.10.2013

pawn Код:
if( /*Aqui б Vбriavel de verificar level do Player */< 1 )  //Esse 1 representa o Score do Player.
        {
            SendClientMessage( playerid, UmaCorAqui, "[ x ] Esse carro so й permitido level 1" );
            RemovePlayerFromVehicle( playerid ); //Ejeta o player do veнculo.
            return 1;
        }
@Edit.
Coloque isso /\ em OnPlayerEnterVehicle



Re: Nivel para dirigir veнculo - CrazYou - 04.10.2013

Quote:
Originally Posted by ThuuGLif3
Посмотреть сообщение
pawn Код:
if( /*Aqui б Vбriavel de verificar level do Player */< 1 )  //Esse 1 representa o Score do Player.
        {
            SendClientMessage( playerid, UmaCorAqui, "[ x ] Esse carro so й permitido level 1" );
            RemovePlayerFromVehicle( playerid ); //Ejeta o player do veнculo.
            return 1;
        }
@Edit.
Coloque isso /\ em OnPlayerEnterVehicle
No caso ficaria assim?
Код:
	if( 99 < 100 )
        {
            SendClientMessage( playerid, 0xFF0000AA, "[ERRO] Vocк nгo tem nнvel suficiente para dirigir este veнculo" );
            RemovePlayerFromVehicle( playerid );
            return 1;
        }
Ta dando esse Warning na linha onde coloca o level fiz algo errado?
Код:
warning 206: redundant test: constant expression is non-zero



Re: Nivel para dirigir veнculo - ThuuGLif3 - 04.10.2013

Oque estб representado esse "99"?

pawn Код:
if( 99 < 100 )
        {
            SendClientMessage( playerid, 0xFF0000AA, "[ERRO] Vocк nгo tem nнvel suficiente para dirigir este veнculo" );
            RemovePlayerFromVehicle( playerid );
            return 1;
        }



Re: Nivel para dirigir veнculo - Cidiei - 04.10.2013

pawn Код:
if(GetPlayerScore(playerid) >= valor)//mude valor para o nivel
{
    SendClientMessage(playerid,COR,"[x] Nнvel nгo suficiente");//Mude 'COR' para alguma cor hexadecimal
    RemovePlayerFromVehicle(playerid);//Ejeta o jogador
    return 1;
}



Re: Nivel para dirigir veнculo - CrazYou - 04.10.2013

Quote:
Originally Posted by ThuuGLif3
Посмотреть сообщение
Oque estб representado esse "99"?

pawn Код:
if( 99 < 100 )
        {
            SendClientMessage( playerid, 0xFF0000AA, "[ERRO] Vocк nгo tem nнvel suficiente para dirigir este veнculo" );
            RemovePlayerFromVehicle( playerid );
            return 1;
        }
Eu ja tinha feito esse sistema e o 99 seria que se o level to cara for de 0 a 99 ele nгo poderб entrar no carro mas eu tinha pegado pronto o sistema


Re: Nivel para dirigir veнculo - RuanRider - 04.10.2013

GetPlayerScore(playerid)


Re: Nivel para dirigir veнculo - CrazYou - 04.10.2013

Quote:
Originally Posted by Cidiei
Посмотреть сообщение
pawn Код:
if(GetPlayerScore(playerid) >= valor)//mude valor para o nivel
{
    SendClientMessage(playerid,COR,"[x] Nнvel nгo suficiente");//Mude 'COR' para alguma cor hexadecimal
    RemovePlayerFromVehicle(playerid);//Ejeta o jogador
    return 1;
}
E se eu quiser colocar um carro especнfico?


Re: Nivel para dirigir veнculo - ThuuGLif3 - 04.10.2013

pawn Код:
if( GetPlayerScore(playerid) < 100 )
        {
            SendClientMessage( playerid, 0xFF0000AA, "[ERRO] Vocк nгo tem nнvel suficiente para dirigir este veнculo" );
            RemovePlayerFromVehicle( playerid );
            return 1;
        }
Qualquer dъvida, Procure aqui.
https://sampwiki.blast.hk/wiki/GetPlayerScore

@Edit.

Para um veнculo especifico basta adicionar

pawn Код:
if(GetVehicleModel(vehicleid) == 470) //470 й o ID do Patriot.
        {



Re: Nivel para dirigir veнculo - CrazYou - 04.10.2013

Quote:
Originally Posted by ThuuGLif3
Посмотреть сообщение
pawn Код:
if( GetPlayerScore(playerid) < 100 )
        {
            SendClientMessage( playerid, 0xFF0000AA, "[ERRO] Vocк nгo tem nнvel suficiente para dirigir este veнculo" );
            RemovePlayerFromVehicle( playerid );
            return 1;
        }
Qualquer dъvida, Procure aqui.
https://sampwiki.blast.hk/wiki/GetPlayerScore
Mas e seu eu quiser colocar um carro especнfico?