[pedido]codigo para zcmd
#1

pawn Код:
if(!strcmp("/duelo", cmd, true))
    {
   new cmd[128];
    new idx;
    new id;
    cmd = otherplayerids(cmdtext, idx);

        new tmp[128];
        new string[128];
        tmp = otherplayerids(cmdtext, idx);
        id = strval(tmp);
        if(InvitedDuel[playerid] == true) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : Vocк Jб Convidou alguйm,Aguarde Expirar o Convite");
        if(ArenaUsada == true) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : No momento a Arena estб Sendo Usada");
        if(!strlen(tmp)) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : Vocк deve digitar os ID do Player seguindo a Maneira (/duelo-run [playerid])");
        if(id == playerid) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : Vocк nгo pode convidar a Si-Mesmo");
        if(InvitedDuel[id] == true) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : No Momento o Player estб em um Duelo, Aguarde..");
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "»»[DUELO]«« : %s esta lhe convidando  para um \n Duelo Leve (Clique Aceitar para Aceitar)",name);
        ShowPlayerDialog(id,DIALOG_DUELO,DIALOG_STYLE_MSGBOX,"»»[DUELO]«« :",string,"Aceitar", "Recusar");
        GameTextForPlayer(id,"~r~DUE~w~LO !", 2500, 3);
        InvitedDuel[id] = true;
        IdDuel[id] = playerid;
        SetTimerEx("LimparDuelo",15000,false,"ii",id,playerid);
        return 1;
    }
    return 0;
}
Titulo auto explicativo, eu passei e n funciono quem sabe vcs tem mai conhecimento,

credito do comando [Fek]Drakins, so nгo usso como fs que ta dando conflito com o fs de admin
Reply
#2

Tenta assim, nгo garanto pq nunca usei ZCMD sem sscanf ;/

PHP код:
    CMD:duelo(playeridparams[])
    {
        new 
cmd[128];
        new 
idx;
        new 
id;
        
cmd otherplayerids(paramsidx);
            new 
tmp[128];
            new 
string[128];
            
tmp otherplayerids(paramsidx);
            
id strval(tmp);
            if(
InvitedDuel[playerid] == true) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : Vocк Jб Convidou alguйm,Aguarde Expirar o Convite");
            if(
ArenaUsada == true) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : No momento a Arena estб Sendo Usada");
            if(!
strlen(tmp)) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : Vocк deve digitar os ID do Player seguindo a Maneira (/duelo-run [playerid])");
            if(
id == playerid) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : Vocк nгo pode convidar a Si-Mesmo");
            if(
InvitedDuel[id] == true) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : No Momento o Player estб em um Duelo, Aguarde..");
            new 
name[MAX_PLAYER_NAME];
            
GetPlayerName(playeridnamesizeof(name));
            
format(stringsizeof(string), "»»[DUELO]«« : %s esta lhe convidando  para um \n Duelo Leve (Clique Aceitar para Aceitar)",name);
            
ShowPlayerDialog(id,DIALOG_DUELO,DIALOG_STYLE_MSGBOX,"»»[DUELO]«« :",string,"Aceitar""Recusar");
            
GameTextForPlayer(id,"~r~DUE~w~LO !"25003);
            
InvitedDuel[id] = true;
            
IdDuel[id] = playerid;
            
SetTimerEx("LimparDuelo",15000,false,"ii",id,playerid);
            return 
1;
        } 
Coloca ele fora da public OnPlayerCommandText e de qualquer outra public.
Reply
#3

й igual o que eu fiz, o comando nгo funciona '-', fica so aparecendo a msg de ajuda
Reply
#4

Converti o comando para vocк :


pawn Код:
CMD:duelo(playerid, params[])
{
    new string[128];
    if(InvitedDuel[playerid] == true) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : Vocк Jб Convidou alguйm,Aguarde Expirar o Convite");
    if(ArenaUsada == true) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : No momento a Arena estб Sendo Usada");
    if(isnull(params)) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : Vocк deve digitar os ID do Player seguindo a Maneira (/duelo-run [playerid])");
    new id = strval(params);
    if(id == playerid) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : Vocк nгo pode convidar a Si-Mesmo");
    if(InvitedDuel[id] == true) return SendClientMessage(playerid,0xF41917AA,"»»[DUELO]«« : No Momento o Player estб em um Duelo, Aguarde..");
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "»»[DUELO]«« : %s esta lhe convidando  para um \n Duelo Leve (Clique Aceitar para Aceitar)",name);
    ShowPlayerDialog(id,DIALOG_DUELO,DIALOG_STYLE_MSGBOX,"»»[DUELO]«« :",string,"Aceitar", "Recusar");
    GameTextForPlayer(id,"~r~DUE~w~LO !", 2500, 3);
    InvitedDuel[id] = true;
    IdDuel[id] = playerid;
    SetTimerEx("LimparDuelo",15000,false,"ii",id,playerid);
    return 1;
}


Espero ter ajudado .
Reply
#5

vlws, todos pela ajuda e boa noite '-'

atй

@edit
mais uma coisa '-'

converte isso pra sscanf e zcmd pra eu etender??

pawn Код:
CMD:stunt01(playerid, params[])
{
    TogglePlayerControllable(playerid,0);
    if(!IsPlayerInAnyVehicle(playerid)){
        SetPlayerPos(playerid,-2852.5603,2193.9573,175.1964);
        SetPlayerFacingAngle(playerid, 0.0);
        SetTimerEx("Unfreeze", 2000, 0, "d", playerid);
        new string[128], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "{FF0000}(/stunt01) {FFFF00}Player %s Foi teleportado para Stunt01",pName);
        GameTextForPlayer(playerid,"~g~Carregando objetos",2000,3);
        SetPlayerInterior(playerid, 0);
        SendClientMessageToAll(playerid, string);
        SetPlayerVirtualWorld(playerid, 0);
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)