[Ajuda] Colocar uma menssagem pra todos online
#1

Olб tem algum de vocкs fazer esse codigo > /multar id quantia < ficar assim > /multar id quantia motivo <
Dai quando ele digita o motivo aparece lб no chat para todos onlines escrito mais o menos assim o > O Polнcia Multou o Jogador RianRBS no valor 500 motivo: porque ele й gay < sу um exemplo pra vocкs saber como eu quer que o comando fique !!

Код HTML:
if(strcmp(cmd, "/multar", true) == 0)
{
	new aname[MAX_PLAYER_NAME];

	GetPlayerName(playerid, aname, MAX_PLAYER_NAME);

	format(file, sizeof(file), PASTA_CONTAS, aname);

	if(dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "Profissao") == LSPD || dini_Int(file, "aAdmin") == 1 || IsPlayerAdmin(playerid))
	{
		new tmp[256];
		new plid;

		new quant;

		tmp = strtok(cmdtext, idx);

		if(!strlen(tmp))
		{
			SendClientMessage(playerid, Vermelho, "/multar [id] [quantidade]");
			return 1;
		}

		plid = strval(tmp);

		tmp = strtok(cmdtext, idx);

		if(!strlen(tmp))
		{
			SendClientMessage(playerid, Vermelho, "/multar [id] [quantidade]");
			return 1;
		}

		if(UsouID[plid] == true) return SendClientMessage(playerid, Vermelho, "Espere 1 Minutos para Multar esse ID Novamente!");

		quant = strval(tmp);

		if(quant > 1000 || quant <= 0)
		{
			SendClientMessage(playerid, Vermelho, "(INFO) Vocк nгo estб multando de forma justa.");
			return 1;
		}

		if(IsPlayerConnected(plid))
		{
			new pname[MAX_PLAYER_NAME];

			GetPlayerName(plid, pname, MAX_PLAYER_NAME);

			format(file2, sizeof(file2), PASTA_CONTAS, pname);

			format(string, sizeof(string), "(INFO) Vocк recebeu uma multa de R$%d Pelo policial %s . O dinheiro foi retirado do banco.", quant, aname);
			SendClientMessage(plid, COLOR_GREEN, string);

			SendClientMessage(playerid, COLOR_GREEN, "(INFO) Multa dada.");

			UsouID[plid] = true;

			SetTimerEx("ResetarMultados", 60000, true, "i", plid);

			dini_IntSet(file2, "SaldoBancario", dini_Int(file2, "SaldoBancario")- quant);
			return 1;
		}
		else
		{
			SendClientMessage(playerid, Vermelho, "(INFO) O jogador nгo estб conectado!");
			return 1;
		}
	}
}
Reply
#2

Tenta

pawn Код:
if(strcmp(cmd, "/multar", true) == 0)
{
    new aname[MAX_PLAYER_NAME];

    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);

    format(file, sizeof(file), PASTA_CONTAS, aname);

    if(dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "Profissao") == LSPD || dini_Int(file, "aAdmin") == 1 || IsPlayerAdmin(playerid))
    {
        new tmp[256];
        new plid;

        new quant;

        tmp = strtok(cmdtext, idx);

        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "/multar [id] [quantidade]");
            return 1;
        }

        plid = strval(tmp);

        tmp = strtok(cmdtext, idx);

        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "/multar [id] [quantidade]");
            return 1;
        }

        if(UsouID[plid] == true) return SendClientMessage(playerid, Vermelho, "Espere 1 Minutos para Multar esse ID Novamente!");

        quant = strval(tmp);

        if(quant > 1000 || quant <= 0)
        {
            SendClientMessage(playerid, Vermelho, "(INFO) Vocк nгo estб multando de forma justa.");
            return 1;
        }

        if(IsPlayerConnected(plid))
        {
            new pname[MAX_PLAYER_NAME];

            GetPlayerName(plid, pname, MAX_PLAYER_NAME);

            format(file2, sizeof(file2), PASTA_CONTAS, pname);

            format(string, sizeof(string), "(INFO) Vocк recebeu uma multa de R$%d Pelo policial %s . O dinheiro foi retirado do banco.", quant, aname);
            SendClientMessage(plid, COLOR_GREEN, string);
           
            format(string, sizeof(string), "(INFO) ATENЗГO : %d Foi multado pelo Policial %s com uma quantia de %d.", GetPlayerName , aname , quant );
            SendClientMessageAll(plid, COLOR_GREEN, string);

            SendClientMessage(playerid, COLOR_GREEN, "(INFO) Multa dada.");

            UsouID[plid] = true;

            SetTimerEx("ResetarMultados", 60000, true, "i", plid);

            dini_IntSet(file2, "SaldoBancario", dini_Int(file2, "SaldoBancario")- quant);
            return 1;
        }
        else
        {
            SendClientMessage(playerid, Vermelho, "(INFO) O jogador nгo estб conectado!");
            return 1;
        }
    }
}
Reply
#3

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

pawn Код:
if(strcmp(cmd, "/multar", true) == 0)
{
    new aname[MAX_PLAYER_NAME];

    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);

    format(file, sizeof(file), PASTA_CONTAS, aname);

    if(dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "Profissao") == LSPD || dini_Int(file, "aAdmin") == 1 || IsPlayerAdmin(playerid))
    {
        new tmp[256];
        new plid;

        new quant;

        tmp = strtok(cmdtext, idx);

        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "/multar [id] [quantidade]");
            return 1;
        }

        plid = strval(tmp);

        tmp = strtok(cmdtext, idx);

        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "/multar [id] [quantidade]");
            return 1;
        }

        if(UsouID[plid] == true) return SendClientMessage(playerid, Vermelho, "Espere 1 Minutos para Multar esse ID Novamente!");

        quant = strval(tmp);

        if(quant > 1000 || quant <= 0)
        {
            SendClientMessage(playerid, Vermelho, "(INFO) Vocк nгo estб multando de forma justa.");
            return 1;
        }

        if(IsPlayerConnected(plid))
        {
            new pname[MAX_PLAYER_NAME];

            GetPlayerName(plid, pname, MAX_PLAYER_NAME);

            format(file2, sizeof(file2), PASTA_CONTAS, pname);

            format(string, sizeof(string), "(INFO) Vocк recebeu uma multa de R$%d Pelo policial %s . O dinheiro foi retirado do banco.", quant, aname);
            SendClientMessage(plid, COLOR_GREEN, string);
           
            format(string, sizeof(string), "(INFO) ATENЗГO : %d Foi multado pelo Policial %s com uma quantia de %d.", GetPlayerName , aname , quant );
            SendClientMessageAll(plid, COLOR_GREEN, string);

            SendClientMessage(playerid, COLOR_GREEN, "(INFO) Multa dada.");

            UsouID[plid] = true;

            SetTimerEx("ResetarMultados", 60000, true, "i", plid);

            dini_IntSet(file2, "SaldoBancario", dini_Int(file2, "SaldoBancario")- quant);
            return 1;
        }
        else
        {
            SendClientMessage(playerid, Vermelho, "(INFO) O jogador nгo estб conectado!");
            return 1;
        }
    }
}
Deu 3 erros
C:\Users\RianRBS\Desktop\gm\gamemodes\rian.pwn(569 0) : warning 203: symbol is never used: "txtid"
C:\Users\RianRBS\Desktop\gm\gamemodes\rian.pwn(114 76) : error 076: syntax error in the expression, or invalid function call
C:\Users\RianRBS\Desktop\gm\gamemodes\rian.pwn(114 77) : error 017: undefined symbol "SendClientMessageAll"
C:\Users\RianRBS\Desktop\gm\gamemodes\rian.pwn(167 83) : warning 216: nested comment
C:\Users\RianRBS\Desktop\gm\gamemodes\rian.pwn(174 2 : warning 209: function "GPS" should return a value
C:\Users\RianRBS\Desktop\gm\gamemodes\rian.pwn(180 49) : warning 203: symbol is never used: "entrarutlls"
C:\Users\RianRBS\Desktop\gm\gamemodes\rian.pwn(180 49) : warning 203: symbol is never used: "entrarutllv"
C:\Users\RianRBS\Desktop\gm\gamemodes\rian.pwn(180 49) : warning 203: symbol is never used: "sairutllv"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#4

Oq tu usa pra mandar a mensagem pra todo mundo ? EX : o meu й SendClientMessageAll ai troca pelo seu

ah , nessa linha tu deixa assim

format(string, sizeof(string), "(INFO) ATENЗГO : %s Foi multado pelo Policial %s com uma quantia de %d.", GetPlayerName , aname , quant );
Reply
#5

Usa assim:
PHP код:
SendClientMessageToAll(colorstring[]); 
Reply
#6

Quote:
Originally Posted by Lucas_Rocha
Посмотреть сообщение
Oq tu usa pra mandar a mensagem pra todo mundo ? EX : o meu й SendClientMessageAll ai troca pelo seu

ah , nessa linha tu deixa assim

format(string, sizeof(string), "(INFO) ATENЗГO : %s Foi multado pelo Policial %s com uma quantia de %d.", GetPlayerName , aname , quant );
Saca eu mudei pra minha, mais qnd eu multo aparece pra todos, mais nгo aparece o nome do polнcial que mutou e nйm o valor q o cara foi multado diz isso aqui o > Atenзгo : 83 Foi multado pelo policial com uma quantia de R$.
Reply
#7

Na linha la q eu falei Sendclientmessageall coloca q nem o luan pra geral ver

enquanto o 83 ve se antes do " Foi multado " ta %s nгo %d
Reply
#8

Quote:
Originally Posted by Lucas_Rocha
Посмотреть сообщение
Na linha la q eu falei Sendclientmessageall coloca q nem o luan pra geral ver

enquanto o 83 ve se antes do " Foi multado " ta %s nгo %d
Agora estб aparecendo o nome do jogador que foi Multado, mais nгo aparece no valor que ele foi multado aparece sу R$
Reply
#9

Quote:
Originally Posted by RianRBS
Посмотреть сообщение
Agora estб aparecendo o nome do jogador que foi Multado, mais nгo aparece no valor que ele foi multado aparece sу R$
nгo sei se vai funcionar.. strcmp й muito ultrapassado alйm de ser mais dificil ...

PHP код:
if(strcmp(cmd"/multar"true) == 0)
{
    new
    
aname[MAX_PLAYER_NAME]
    ;
    
GetPlayerName(playeridanameMAX_PLAYER_NAME);
    
format(filesizeof(file), PASTA_CONTASaname);
    if(
dini_Int(file"Profissao") == Policial_C || dini_Int(file"Profissao") == Policial_F || dini_Int(file"Profissao") == Delegado || dini_Int(file"Profissao") == Bope || dini_Int(file"Profissao") == Swat || dini_Int(file"Profissao") == Narcoticos || dini_Int(file"Profissao") == Policial_M || dini_Int(file"Profissao") == FBI || dini_Int(file"Profissao") == Interpol || dini_Int(file"Profissao") == LSPD || dini_Int(file"aAdmin") == || IsPlayerAdmin(playerid))
    {
        new
        
tmp[256],
        
plid,
        
quant,
        
motivo[64]
        ;
        
tmp strtok(cmdtextidx);
        if(
strlen(tmp))
        return 
SendClientMessage(playerid, -1"/multar [id] [quantidade] [motivo]");
        
plid strval(tmp);
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        return 
SendClientMessage(playerid, -1"/multar [id] [quantidade] [motivo]");
        if(
UsouID[plid] == true)
        return 
SendClientMessage(playerid, -1"Espere 1 Minutos para Multar esse ID Novamente!");
        
quant strval(tmp);
        if(
quant 1000 || quant <= 0)
        return 
SendClientMessage(playerid, -1"(INFO) Vocк nгo estб multando de forma justa.");
        new 
length strlen(cmdtext);
        while ((
idx length) && (cmdtext[idx] <= ' '))
        {
            
idx++;
        }
        new 
offset idx;
        while ((
idxex length) && ((idxex offset) < (sizeof(motivo) - 1)))
        {
            
motivo[idx offset] = cmdtext[idx];
            
idx++;
        }
        
motivo[idx offset] = EOS;
        if(!
strlen(motivo))
        return 
SendClientMessage(playerid,0xFFFFAA,"Uso correto: /banip [id] [motivo].");
        if(
IsPlayerConnected(plid))
        {
            new 
pname[MAX_PLAYER_NAME];
            
GetPlayerName(plidpnameMAX_PLAYER_NAME);
            
format(file2sizeof(file2), PASTA_CONTASpname);
            
format(stringsizeof(string), "(INFO) Vocк recebeu uma multa de R$%d Pelo policial %s . O dinheiro foi retirado do banco."quantaname);
            
SendClientMessage(plidCOLOR_GREENstring);
            
format(stringsizeof(string), "(INFO) O jogador %s recebeu uma multa de R$%d Pelo policial %s pelo motivo [ %s ] . O dinheiro foi retirado do banco." pnamequantanamemotivo);
            
SendClientMessageToAllCOLOR_GREENstring );
            
UsouID[plid] = true;
            
SetTimerEx("ResetarMultados"60000true"i"plid);
            
dini_IntSet(file2"SaldoBancario"dini_Int(file2"SaldoBancario")- quant);
            return 
1;
        }
        else
        {
            
SendClientMessage(playerid, -1"(INFO) O jogador nгo estб conectado!");
            return 
1;
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)