[Pedido] ! Comando em strcmp !
#2

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
Reply


Messages In This Thread
! Comando em strcmp ! - by LoostGamer - 05.10.2012, 13:06
Re: ! Comando em strcmp ! - by humildadeforever - 05.10.2012, 13:13
Re: ! Comando em strcmp ! - by LoostGamer - 05.10.2012, 13:18
Re: ! Comando em strcmp ! - by humildadeforever - 05.10.2012, 13:26
Re: ! Comando em strcmp ! - by LoostGamer - 05.10.2012, 13:29

Forum Jump:


Users browsing this thread: 1 Guest(s)