[Ajuda] Comando Só Vai Para o ID 0 .
#1

Arranjei Aki Um Comando De Recrutar Algum Membro Para Tal Org, Eu Boto O Comando E Aparece La Tudo Certinho, Mais Quando Boto O Comando Para Ver Se A Pessoa Ta Na Org, O Comando Foi Pro Id 0 .
Exemplo Como Se Fosse Cmd De Adm
Do Adm Pro Id 20, Quem Ganha O Adm é O ID 0
Ajuda A Arrumar Ai PF .

Код:
    if(strcmp(cmd,"/recrutarfec", true)==0){
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(pAdmin[playerid] >= 5){
    new plid, skin;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)){
    SendClientMessage(playerid, Vermelho, "** Digite: /recrutarfec [id] [ 1 a 8 ]");
    return 1;
    }
    plid = strval(tmp);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) {
    SendClientMessage(playerid, Vermelho, "** Digite: [id] [ 1 a 8 ]");
    return 1;
    }
    skin = strval(tmp);
    if(skin>=9){
    SendClientMessage(playerid, Vermelho, "(ERRO) Level nao corresponde a nenhuma Patente Da FEC!");
    return 1;
    }
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(plid, pname, MAX_PLAYER_NAME);
    if(IsPlayerConnected(plid)){
    if(skin == 1){
    dini_IntSet(filene(aname),"FECF", 1);
   	PlayerInfo[playerid][pFECF] = 1 ;
	dini_IntSet(filene(aname),"Profissao", 65);
    format(string, sizeof(string), "» O Dono %s (%d) (») Promoveu: %s (%d) para Fuzileiro da [FEC].", aname,playerid,pname,plid,skin);
    SendClientMessageToAll(Verde, string);
    }
    if(skin == 2){
    dini_IntSet(filene(aname),"FECA", 1);
    PlayerInfo[playerid][pFECA] = 1 ;
    dini_IntSet(filene(aname),"Profissao", 65);
    format(string, sizeof(string), "» O Dono %s (%d) (») Promoveu: %s (%d) para Atirador da [FEC].", aname,playerid,pname,plid,skin);
    SendClientMessageToAll(Verde, string);
    }
    if(skin == 3){
	dini_IntSet(filene(aname),"FECT", 1);
   	PlayerInfo[playerid][pFECT] = 1 ;
	dini_IntSet(filene(aname),"Profissao", 65);
    format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Terrorista da [FEC].", aname,playerid,pname,plid,skin);
    SendClientMessageToAll(Verde, string);
    }
    if(skin == 4){
	dini_IntSet(filene(aname),"FECM", 1);
   	PlayerInfo[playerid][pFECM] = 1 ;
	dini_IntSet(filene(aname),"Profissao", 65);
    format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Médico da [FEC].", aname,playerid,pname,plid,skin);
    SendClientMessageToAll(Verde, string);
    }
    if(skin == 5){
	dini_IntSet(filene(aname),"FECS", 1);
   	PlayerInfo[playerid][pFECS] = 1 ;
	dini_IntSet(filene(aname),"Profissao", 65);
    format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Sniper da [FEC].", aname,playerid,pname,plid,skin);
    SendClientMessageToAll(Verde, string);
    }
    if(skin == 6){
    dini_IntSet(filene(aname),"FECH", 1);
    PlayerInfo[playerid][pFECH] = 1 ;
    dini_IntSet(filene(aname),"Profissao", 65);
    format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Piloto da [FEC].", aname,playerid,pname,plid,skin);
    SendClientMessageToAll(Verde, string);
    }
    if(skin == 7){
    dini_IntSet(filene(aname),"FECO", 1);
    PlayerInfo[playerid][pFECO] = 1 ;
    dini_IntSet(filene(aname),"Profissao", 65);
    format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Olheiro Do Trafico da [FEC].", aname,playerid,pname,plid,skin);
    SendClientMessageToAll(Verde, string);
    }
    if(skin == 8){
    dini_IntSet(filene(aname),"FEC", 1);
   	PlayerInfo[playerid][pFEC] = 1 ;
    dini_IntSet(filene(aname),"Profissao", 65);
    format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Dono da [FEC].", aname,playerid,pname,plid,skin);
    SendClientMessageToAll(Verde, string);
    }
    if(skin == 0){
    dini_IntSet(filene(aname),"FEC", 0);
    dini_IntSet(filene(aname),"FECA", 0);
    dini_IntSet(filene(aname),"FECF", 0);
    dini_IntSet(filene(aname),"FECO", 0);
    dini_IntSet(filene(aname),"FECH", 0);
    dini_IntSet(filene(aname),"FECS", 0);
    dini_IntSet(filene(aname),"FECM", 0);
   	dini_IntSet(filene(aname),"FECT", 0);
    format(string, sizeof(string), "» O Dono %s (%d) (») retirou o jogador: %s (%d) da [FEC].", aname,playerid,pname,plid); // assim ?
    SendClientMessageToAll(Verde, string);
    }
    return 1;
    }else{
    SendClientMessage(playerid, Vermelho, "** Jogador não conectado.");
    return 1;
    }
    }
    }
Reply
#2

Arranje a identaзгo... e use sscanf...
Reply
#3

cara

idente o codigo, otimize-o

use isto

https://sampforum.blast.hk/showthread.php?tid=120356

e

isto

http://tabulador.medianewsonline.com/


que o ajudara.
Reply
#4

Qual mensagem vocк recebe de retorno quando digita o comando?
E qual a sintaxe do comando que vocк usou?
Tente dar mais informaзгo referente ao problema, para achar a soluзгo.
Reply
#5

Quote:
Originally Posted by Schocc
Посмотреть сообщение
Qual mensagem vocк recebe de retorno quando digita o comando?
E qual a sintaxe do comando que vocк usou?
Tente dar mais informaзгo referente ao problema, para achar a soluзгo.
O Dono Da FEC "Nick" Promoveu "OutroNick" Para Terrorsita Da FEC .
Mais Se Ele For Id 0, Vai de boa, mais eu era id 11 e ele 26, e quando botei /FEC tinha promovido o id 0


@Edit

Eu Fui Fazer Teste Em Outro Computador, Tentei Recrutar Com ID 1, Mais Só Vai Pro ID 1, Ex: Só Quem Recrutar Que Ganha A Patente Da FEC .
Reply
#6

pawn Код:
if ( !strcmp(cmd,"/recrutarfec", true)) {

    if ( pAdmin[playerid] < 5 )
        return false;

    new plid, skin;
    tmp = strtok(cmdtext, idx);
   
    if (!strlen(tmp))
        return SendClientMessage(playerid, Vermelho, "** Digite: /recrutarfec [id] [ 1 a 8 ]");
   
    plid = strval(tmp);
    tmp = strtok(cmdtext, idx);
   
    if(!strlen(tmp))
        return SendClientMessage(playerid, Vermelho, "** Digite: [id] [ 1 a 8 ]");
   
    skin = strval(tmp);
   
    if(!IsPlayerConnected(plid))
        return SendClientMessage(playerid, Vermelho, "** Jogador nгo conectado.");

    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(plid, pname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, pname);

    switch ( skin ) {

        case 0: {
            dini_IntSet(file,"FEC", 0);
            dini_IntSet(file,"FECA", 0);
            dini_IntSet(file,"FECF", 0);
            dini_IntSet(file,"FECO", 0);
            dini_IntSet(file,"FECH", 0);
            dini_IntSet(file,"FECS", 0);
            dini_IntSet(file,"FECM", 0);
            dini_IntSet(file,"FECT", 0);
            format(string, sizeof(string), "» O Dono %s (%d) (») retirou o jogador: %s (%d) da [FEC].", aname,playerid,pname,plid); // assim ?
            SendClientMessageToAll(Verde, string);
        }
        case 1: {
       
            dini_IntSet(file,"FECF", 1);
            PlayerInfo[plid][pFECF] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) (») Promoveu: %s (%d) para Fuzileiro da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
        }
        case 2: {
            dini_IntSet(file,"FECA", 1);
            PlayerInfo[plid][pFECA] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) (») Promoveu: %s (%d) para Atirador da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
            }
        case 3: {
            dini_IntSet(file,"FECT", 1);
            PlayerInfo[plid][pFECT] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Terrorista da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
        }
        case 4 : {
            dini_IntSet(file,"FECM", 1);
            PlayerInfo[plid][pFECM] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Mйdico da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
        }
        case 5: {
            dini_IntSet(file,"FECS", 1);
            PlayerInfo[plid][pFECS] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Sniper da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
        }
        case 6: {
            dini_IntSet(file ,"FECH", 1);
            PlayerInfo[plid][pFECH] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Piloto da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
        }
        case 7: {
            dini_IntSet(file,"FECO", 1);
            PlayerInfo[plid][pFECO] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Olheiro Do Trafico da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
        }
        case 8: {
            dini_IntSet(file,"FEC", 1);
            PlayerInfo[plid][pFEC] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Dono da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
        }
        default: SendClientMessage(playerid, Vermelho, "** Skin invбlida! Use valores de 0 a 8!");

    }
    return 1;
}
Vк se irб compilar.

O erro estб aqui.

pawn Код:
PlayerInfo[playerid][pFECF] = 1 ;
Correto

pawn Код:
PlayerInfo[plid][pFECF] = 1 ;
Nгo sу no exemplo mostrado acima mas em todos os casos!

@edit

E tambйm na escrita nos arquivos das contas dos jogadores.
Reply
#7

Quote:
Originally Posted by iCasTiel
Посмотреть сообщение
pawn Код:
if ( !strcmp(cmd,"/recrutarfec", true)) {

    if ( pAdmin[playerid] < 5 )
        return false;

    new plid, skin;
    tmp = strtok(cmdtext, idx);
   
    if (!strlen(tmp))
        return SendClientMessage(playerid, Vermelho, "** Digite: /recrutarfec [id] [ 1 a 8 ]");
   
    plid = strval(tmp);
    tmp = strtok(cmdtext, idx);
   
    if(!strlen(tmp))
        return SendClientMessage(playerid, Vermelho, "** Digite: [id] [ 1 a 8 ]");
   
    skin = strval(tmp);
   
    if(!IsPlayerConnected(plid))
        return SendClientMessage(playerid, Vermelho, "** Jogador nгo conectado.");

    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(plid, pname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, pname);

    switch ( skin ) {

        case 0: {
            dini_IntSet(file,"FEC", 0);
            dini_IntSet(file,"FECA", 0);
            dini_IntSet(file,"FECF", 0);
            dini_IntSet(file,"FECO", 0);
            dini_IntSet(file,"FECH", 0);
            dini_IntSet(file,"FECS", 0);
            dini_IntSet(file,"FECM", 0);
            dini_IntSet(file,"FECT", 0);
            format(string, sizeof(string), "» O Dono %s (%d) (») retirou o jogador: %s (%d) da [FEC].", aname,playerid,pname,plid); // assim ?
            SendClientMessageToAll(Verde, string);
        }
        case 1: {
       
            dini_IntSet(file,"FECF", 1);
            PlayerInfo[plid][pFECF] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) (») Promoveu: %s (%d) para Fuzileiro da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
        }
        case 2: {
            dini_IntSet(file,"FECA", 1);
            PlayerInfo[plid][pFECA] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) (») Promoveu: %s (%d) para Atirador da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
            }
        case 3: {
            dini_IntSet(file,"FECT", 1);
            PlayerInfo[plid][pFECT] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Terrorista da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
        }
        case 4 : {
            dini_IntSet(file,"FECM", 1);
            PlayerInfo[plid][pFECM] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Mйdico da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
        }
        case 5: {
            dini_IntSet(file,"FECS", 1);
            PlayerInfo[plid][pFECS] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Sniper da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
        }
        case 6: {
            dini_IntSet(file ,"FECH", 1);
            PlayerInfo[plid][pFECH] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Piloto da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
        }
        case 7: {
            dini_IntSet(file,"FECO", 1);
            PlayerInfo[plid][pFECO] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Olheiro Do Trafico da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
        }
        case 8: {
            dini_IntSet(file,"FEC", 1);
            PlayerInfo[plid][pFEC] = 1 ;
            dini_IntSet(file,"Profissao", 65);
            format(string, sizeof(string), "» O Dono %s (%d) Promoveu: %s (%d) para Dono da [FEC].", aname,playerid,pname,plid,skin);
            SendClientMessageToAll(Verde, string);
        }
        default: SendClientMessage(playerid, Vermelho, "** Skin invбlida! Use valores de 0 a 8!");

    }
    return 1;
}
Vк se irб compilar.

O erro estб aqui.

pawn Код:
PlayerInfo[playerid][pFECF] = 1 ;
Correto

pawn Код:
PlayerInfo[plid][pFECF] = 1 ;
Nгo sу no exemplo mostrado acima mas em todos os casos!

@edit

E tambйm na escrita nos arquivos das contas dos jogadores.
@Edit
A Vei, Tentei Fazer O Meu Não Funfo, Copiei O Seu, E Funcionou, Muito Obrigado, Vo Tentar Te Dar +Rap .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)