[Ajuda] Converter comando.
#1

Alguem poderia converter esse comando pra mim pra ZCMD?

PHP код:
    new cmd[256];
    new 
tmp[256];
    new 
idx;
    
cmd strtok(cmdtextidx);
     new 
giveplayer[MAX_PLAYER_NAME];
     new 
string[256];
    if(
strcmp(cmd"/ejetarplayer"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
           {
            new 
State;
            if(
IsPlayerInAnyVehicle(playerid))
            {
                 
State=GetPlayerState(playerid);
                if(
State!=PLAYER_STATE_DRIVER)
                {
                    
SendClientMessage(playerid,-1,"   Vocк nгo й o motorista do carro !");
                    return 
true;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playerid, -1"USE: /ejetar [id]");
                    return 
true;
                }
                new 
playa;
                new 
test;
                
test GetPlayerVehicleID(playerid);
                if(
IsPlayerConnected(playa))
                {
                    if(
playa != INVALID_PLAYER_ID)
                    {
                        if(
playa == playerid) { SendClientMessage(playerid, -1"Vocк nгo pode se expulsar... Aperte Enter ¬¬!"); return true; }
                        if(
IsPlayerInVehicle(playa,test))
                        {
                            new 
PName[MAX_PLAYER_NAME];
                            
GetPlayerName(playerid,PName,sizeof(PName));
                            
GetPlayerName(playagiveplayersizeof(giveplayer));
                            
format(stringsizeof(string), "* Vocк expulsou o(a) %s para fora do carro!"giveplayer);
                            
SendClientMessage(playerid, -1string);
                            
format(stringsizeof(string), "* Vocк foi retirado do carro por %s !"PName);
                            
SendClientMessage(playa, -1string);
                            
RemovePlayerFromVehicle(playa);
                        }
                        else
                        {
                            
SendClientMessage(playerid, -1"   Este jogador nгo estб em seu carro !");
                            return 
true;
                        }
                    }
                }
                else
                {
                    
SendClientMessage(playerid, -1" ID/Nick - Invalido!");
                }
            }
            else
            {
                
SendClientMessage(playerid, -1"   Vocк precisa estar em um carro para usar este comando !");
            }
        }
        return 
true;
    } 
Reply
#2

Assim ?
pawn Код:
new cmd[256];
    new tmp[256];
    new idx;
    cmd = strtok(cmdtext, idx);
     new giveplayer[MAX_PLAYER_NAME];
     new string[256];

    CMD:ejetarplayer(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
           {
            new State;
            if(IsPlayerInAnyVehicle(playerid))
            {
                 State=GetPlayerState(playerid);
                if(State!=PLAYER_STATE_DRIVER)
                {
                    SendClientMessage(playerid,-1,"   Vocк nгo й o motorista do carro !");
                    return true;
                }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, -1, "USE: /ejetar [id]");
                    return true;
                }
                new playa;
                new test;
                test = GetPlayerVehicleID(playerid);
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        if(playa == playerid) { SendClientMessage(playerid, -1, "Vocк nгo pode se expulsar... Aperte Enter ¬¬!"); return true; }
                        if(IsPlayerInVehicle(playa,test))
                        {
                            new PName[MAX_PLAYER_NAME];
                            GetPlayerName(playerid,PName,sizeof(PName));
                            GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                            format(string, sizeof(string), "* Vocк expulsou o(a) %s para fora do carro!", giveplayer);
                            SendClientMessage(playerid, -1, string);
                            format(string, sizeof(string), "* Vocк foi retirado do carro por %s !", PName);
                            SendClientMessage(playa, -1, string);
                            RemovePlayerFromVehicle(playa);
                        }
                        else
                        {
                            SendClientMessage(playerid, -1, "   Este jogador nгo estб em seu carro !");
                            return true;
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, -1, " ID/Nick - Invalido!");
                }
            }
            else
            {
                SendClientMessage(playerid, -1, "   Vocк precisa estar em um carro para usar este comando !");
            }
        }
        return true;
    }
Reply
#3

PHP код:
 CMD:ejetarplayer(playeridparams[])
    {
        new 
playaPName[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME], string[256];

        if(
sscanf(params"u"playa))
            return 
SendClientMessage(playerid, -1"Uso: /ejetarplayer [playerid/nick]");

        if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
            return 
SendClientMessage(playerid,-1,"   Vocк nгo й o motorista do carro !");

        if(
playa == INVALID_PLAYER_ID || playa == playerid)
            return 
SendClientMessage(playerid, -1" ID/Nick - Invalido!");

        if(!
IsPlayerInVehicle(playa,GetPlayerVehicleID(playerid)))
            return 
SendClientMessage(playerid, -1"   Este jogador nгo estб em seu carro !");

        
GetPlayerName(playerid,PName,sizeof(PName));
        
GetPlayerName(playagiveplayersizeof(giveplayer));
        
format(stringsizeof(string), "* Vocк expulsou o(a) %s para fora do carro!"giveplayer);
        
SendClientMessage(playerid, -1string);
        
format(stringsizeof(string), "* Vocк foi retirado do carro por %s !"PName);
        
SendClientMessage(playa, -1string);
        
RemovePlayerFromVehicle(playa);

        return 
true;
    } 
Plugin sscanf: https://sampforum.blast.hk/showthread.php?tid=570927
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)