[Pedido] Sistema de Ban com salvamento
#1

Se alguem tiver ai da uma ajuda ai preciso de um sistema dessis vlw
Reply
#2

Por que vocк nгo tenta fazer?? Ficar pedindo codigos prontos й meio nb.
Reply
#3

eu tenho aki mais nгo vo passa. Aprenda, tem duvidas? pergunte!
Reply
#4

Aqui



P.S.: Pessoal, a tag [Pedido] existe para isso.
Reply
#5

ja codei um do zero o poblema fica no salvamento
Reply
#6

rogerio dof2 dini.. ?
Reply
#7

vo tenta pegar uma base dest q o rodney mando vlw ae mais rp
Reply
#8

bom, depende da salvaзгo ser e em dini ou dof etc..
Reply
#9

eu tenho esti aqui quero passa ele pra salva o ip e banir
PHP код:
    if(strcmp(cmd"/ban"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /ban [playerid/ParteDoNome] [motivo]");
                return 
1;
            }
            
giveplayerid ReturnUser(tmp);
//            new playa;
            
new nome[24];
            
GetPlayerName(playeridnomesizeof nome);
            if(
PlayerInfo[playerid][pAdmin] >= || strfind(nomeADMPLAYERtrue) == || strfind(nomeADMPLAYER2true) == 0)
            {
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
giveplayerid != INVALID_PLAYER_ID)
                    {
                        
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        new 
length strlen(cmdtext);
                        while ((
idx length) && (cmdtext[idx] <= ' '))
                        {
                            
idx++;
                        }
                        new 
offset idx;
                        new 
result[64];
                        while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                        {
                            
result[idx offset] = cmdtext[idx];
                            
idx++;
                        }
                        
result[idx offset] = EOS;
                        if(!
strlen(result))
                        {
                            
SendClientMessage(playeridCOLOR_GRAD2"USE: /ban [playerid/ParteDoNome] [motivo]");
                            return 
1;
                        }
                        new 
yearmonth,day;
                        
getdate(yearmonthday);
                        if(
strfind(nomeADMPLAYERtrue) == || strfind(nomeADMPLAYER2true) == 0)
                        {
                            
format(stringsizeof(string), "|ADMIN|: %s foi banido por %s |Motivo: %s (%d-%d-%d)|"giveplayerADMMASTER, (result),month,day,year);
                            
BanLog(string);
                            
format(stringsizeof(string), "|ADMIN|: %s foi banido por %s |Motivo: %s|"giveplayerADMMASTER, (result));
                            
SendClientMessageToAll(LARANJA1string);
                        }
                        else
                        {
                            
format(stringsizeof(string), "|ADMIN|: %s foi banido por %s |Motivo: %s (%d-%d-%d)|"giveplayersendername, (result),month,day,year);
                            
BanLog(string);
                            
format(stringsizeof(string), "|ADMIN|: %s foi banido por %s |Motivo: %s|"giveplayersendername, (result));
                            
SendClientMessageToAll(LARANJA1string);
                        }
                        
Ban(giveplayerid);
                        return 
1;
                    }
                }
//not connected
            
}
            else
            {
                
format(stringsizeof(string), "   %d nгo й um player ativo."giveplayerid);
                
SendClientMessage(playeridCOLOR_GRAD1string);
            }
        }
        return 
1;
    } 
Reply
#10

ai nгo tem nehum salvamento =/

@edit tenta

pawn Код:
if(strcmp(cmd, "/ban", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Uso: /ban [id] [motivo]");
return 1;
}
plid = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(IsPlayerConnected(plid)){
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' ')) {
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, Vermelho, "Uso: /banir [id] [motivo]");
}else{
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "(INFO) %s baniu o Jogador: %s. || Razгo: %s || %d-%d-%d", aname, pname,result,month,day,year);
BanLog(string);
SendClientMessage(plid, 0x80FF00AA, "» Vocк foi banido deve ter feito alguma merda");
SendClientMessage(plid, 0xFFFFFFAA, "» Se foi banido injustamente Tire uma ''SS'' e tente o contato com um de nossos Admins!");
GameTextForPlayer(plid,"~r~banido", 2500, 3);
format(string, sizeof(string), "{00FF00}(INFO) O Administrador %s baniu o jogador: %s. || Razгo: %s.", aname,pname,result);
SendClientMessageToAll(tcadm, string);
dini_IntSet("banidos.ini",pname,1);
Ban(plid);
}
caso variaveis seja diferente do seu gm troque :P .
Reply
#11

vlw vo testar aqui e ver se serve pro meu gm vlw
Reply
#12

Quote:
Originally Posted by Rodney_Francalim
Посмотреть сообщение
Aqui



P.S.: Pessoal, a tag [Pedido] existe para isso.
Mas ai vocк fica dando codigos prontos e ele nгo vai dar nenhum passo para aprender como fazer e ficar pedindo codigos direto.. a tag [PEDIDO] й para pedir explicaзхes sobre tal funзгo e etc, mas comeзaram a usar para codigos prontos e fuu a merda toda
Reply
#13

espero que estude o code =/ pelomenos isso
Reply
#14

Quote:
Originally Posted by tonisantolia
Посмотреть сообщение
Mas ai vocк fica dando codigos prontos e ele nгo vai dar nenhum passo para aprender como fazer e ficar pedindo codigos direto.. a tag [PEDIDO] й para pedir explicaзхes sobre tal funзгo e etc, mas comeзaram a usar para codigos prontos e fuu a merda toda
Eu nгo dei um cуdigo. Errado seria se ele mandasse um cуdigo com erro, e eu corrigisse sem ao menos explicar. Isso sim seria errado. Diferente do cara pegar algo pronto, e ESTUDAR, BASEAR-SE naquilo. Eu aprendi muito fazendo isso, agora se ele vai ou nгo fazer isso, aн jб й outra coisa.

Quote:
Originally Posted by LuxurioN™
[PEDIDO] Solicitar um cуdigo especнfico
Ele solicitou esse cуdigo, eu o atendi. Explicaзгo sobre uma funзгo, й em dъvidas curtas.
Reply
#15

Utilize meu antigo cуdigo

pawn Код:
#include a_samp

new
    bool:Olding[MAX_PLAYERS char]
;



public OnPlayerConnect(playerid)
{
    Olding{playerid} = false;
   
   
    static Nome[28];
    GetPlayerName(playerid, Nome, 24); strcat(Nome,".ips");
    if(fexist(Nome))
    {
        Olding{playerid} = true;
    }
    return true;
}



public OnPlayerSpawn(playerid)
{
    if(Olding[playerid] == true)
    {
        SetPlayerHealth(playerid, 0);
        SendClientMessage(playerid, -1,"Vocк foi morto por que jб foste banido.");
        return 0;
    }
    return 1;
}



public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext,"/BAM", true))
    {
        permBan(playerid);
        return 1;
    }
    return 0;
}


static stock permBan(playerid, motivo[] = "Sem Motivo aparente")
{
    if(IsPlayerConnected(playerid) && !IsPlayerAdmin(playerid))
    {
        static Nome[28], File: Suy;
        GetPlayerName(playerid, Nome, 24); strcat(Nome,".ips");
        Suy = fopen(Nome, io_write);
        fwrite(Suy, motivo);
        fclose(Suy);
        BanEx(playerid, motivo);
    }
    return false;
}
Reply
#16

bom galera estudei um poco os q mandaran ai intendi um poco o q й dini e dof vlw mais ai + RP
Reply
#17

Quote:
Originally Posted by rogerioexper
Посмотреть сообщение
bom galera estudei um poco os q mandaran ai intendi um poco o q й dini e dof vlw mais ai + RP
Melhora um pouco seu portuguкs por que estб muito muito ruim
Reply
#18

Quote:
Originally Posted by Rodney_Francalim
Посмотреть сообщение
Ele solicitou esse cуdigo, eu o atendi. Explicaзгo sobre uma funзгo, й em dъvidas curtas.
usar a tag [PEDIDO] para pedir uma explicaзгo sobre tal funзгo й um assunto especifico, a maioria dos users do fуrum estгo tentando para de induzir os novatos a ficar pedindo cуdigos prontos e colocando eles fazer pesquisa no ******,wiki sa-mp e etc..

Vocк polpou ele do trabalho de pesquisar fazendo a pesquisa pelo o mesmo.

#EDIT Vish acabei de ver que fiz double post malz.
Reply
#19

Quote:
Originally Posted by tonisantolia
Посмотреть сообщение
usar a tag [PEDIDO] para pedir uma explicaзгo sobre tal funзгo й um assunto especifico, a maioria dos users do fуrum estгo tentando para de induzir os novatos a ficar pedindo cуdigos prontos e colocando eles fazer pesquisa no ******,wiki sa-mp e etc..

Vocк polpou ele do trabalho de pesquisar fazendo a pesquisa pelo o mesmo.

#EDIT Vish acabei de ver que fiz double post malz.
Toni, vocк estб errado. Aceite isto.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)