SA-MP Forums Archive
[Pedido] ! Comando em strcmp ! - 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: [Pedido] ! Comando em strcmp ! (/showthread.php?tid=382865)



! Comando em strcmp ! - LoostGamer - 05.10.2012

Eae galera, baixei um GM, e gostei de alguns comandos, mas como eles estгo em CMD queria converte-los para strcmp, segue o code dos comandos:

pawn Код:
CMD:trancar(playerid)
        {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo estб em um veнculo.");
        if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo pode trancar esse veнculo, vocк estб de passageiro!");
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(i == playerid) continue;
            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), i, 0, 1);
        }
        SendClientMessage(playerid, 0x98F5FFAA, "(INFO) Veнculo trancado com sucesso!");
        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
        return 1;
    }

        CMD:destrancar(playerid)
        {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo estб em um veнculo.");
        if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo pode destrancar esse veнculo, vocк estб de passageiro!");
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(i == playerid) continue;
            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), i, 0, 0);
        }
        SendClientMessage(playerid, 0x98F5FFAA, "(INFO) Veнculo destrancado com sucesso!");
        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
        return 1;
    }

Outra coisa, alguйm pode me passar um FS, de sistema bancбrio, que quando digitar /banco abre um dialog com saldo/transferencia/depositar/sacar, mas que possa ser digitado em qualquer lugar, sem ser em interiores ou algo do gкnero.

" +REP PRA QUEM ME AJUDAR "


Re: ! Comando em strcmp ! - humildadeforever - 05.10.2012

pawn Код:
if(strcmp(cmdtext,"/trancar", true) == 0)
{
     if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo estб em um veнculo.");
     if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo pode trancar esse veнculo, vocк estб de passageiro!");
     for(new i=0; i < MAX_PLAYERS; i++)
     {
            if(i == playerid) continue;
            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), i, 0, 1);
     }
     SendClientMessage(playerid, 0x98F5FFAA, "(INFO) Veнculo trancado com sucesso!");
     PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
     return 1;
}
if(strcmp(cmdtext,"/destrancar", true) == 0)
{
     if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo estб em um veнculo.");
     if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo pode destrancar esse veнculo, vocк estб de passageiro!");
     for(new i=0; i < MAX_PLAYERS; i++)
     {
           if(i == playerid) continue;
           SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), i, 0, 0);
     }
     SendClientMessage(playerid, 0x98F5FFAA, "(INFO) Veнculo destrancado com sucesso!");
     PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
     return 1;
}
Sу colocar na OnPlayerCommandText antes do return 0.

Nгo tem segredo nenhum para converter, sу fazer do jeito que fiz e depois da "/" (barra) colocar o comando.
O ruim й converter quando possui parвmetros...



Sistemas de Banco
https://sampforum.blast.hk/showthread.php?pid=1329428#pid1329428
https://sampforum.blast.hk/showthread.php?tid=149300

E olha esse que maneiro: https://sampforum.blast.hk/showthread.php?tid=235245


Re: ! Comando em strcmp ! - LoostGamer - 05.10.2012

Como sempre vocк me ajudando, kkkkk, o sistema de banco й sу traduzir agora, vlww

Comando funcionando perfect

@CLOSE THE TOPIC


Re: ! Comando em strcmp ! - humildadeforever - 05.10.2012

Quote:
Originally Posted by LoostGamer
Посмотреть сообщение
Como sempre vocк me ajudando, kkkkk, o sistema de banco й sу traduzir agora, vlww

Comando funcionando perfect

@CLOSE THE TOPIC
Se traduzir o ъltimo do meu post vai valer a pena, gostei bastante do sistema O.O!

De nada..


Re: ! Comando em strcmp ! - LoostGamer - 05.10.2012

Outra coisa, pode dar uma olhada aki :

http://forum.sa-mp.com/showthread.ph...96#post2154396

Vlw