SA-MP Forums Archive
[Ajuda] Sistema de bicos/trabalhos - 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] Sistema de bicos/trabalhos (/showthread.php?tid=362636)



Sistema de bicos/trabalhos - GrandRig - 25.07.2012

Alguem ai sabe aquele codigo = script , que o jogador digita /trabalhar e com um carro especifico indica um lugar de pega carga ai a pessoa vai la pega a carga e mostra um lugar de descarregar a carga alguem sabe esse script? pf me passa


Re: Sistema de bicos/trabalhos - humildadeforever - 25.07.2012

Vocк vai utilizar:
-zcmd ou strcmp Para criar o comando
-GetVehicleModel(Pega modelo do veнculo) ou GetPlayerVehicleID (Pega ID do veнculo) Para verificar se й o carro que pode usar.
-IsPlayerInVehicle e GetPlayerState Para verificar se ele estб em um veнculo como motorista
-SetTimerEx Caso queira que o jogador seja descongelado apуs alguns segundos
-TogglePlayerControllable Congelar o jogador quando chegar no checkpoint
-SetPlayerCheckpoint Para setar o checkpoint ao player
-Uma variбvel (que pode ser booleana) para verificar se o veнculo estб carregado e para carregб-lo
Exemplo com bool:
pawn Код:
new bool:Carregado[MAX_VEHICLES]; // TOPO DO GAMEMODE

//Quando entrar no Checkpoint
TogglePlayerControllable(playerid, 0);
Carregado[GetPlayerVehicleID(playerid)] = true;

//Para saber se estб carregado:
if(Carregado[GetPlayerVehicleID(playerid)] == false) return SendClientMessage(playerid,-1,"Veiculo nгo estб carregado.");
-OnPlayerEnterCheckpoint Callback chamada quando o player entra num checkpoint (й aqui onde vai por pra travar o jogador, encher o veнculo de cargas,etc)