[AJUDA] Isso ta certo?
#1

Quero que quando o player digita /m, apareзa o id do player que digitou na mensagem.

PHP Code:
CMD:m(playerid, params[])
{
if(
Profissao[playerid] == Policial)
{
SendClientMessageToAll(0xFFFF00AA, "-----------------|* POLICIA MILITAR *|-------------------");
SendClientMessageToAll(0xFFFF00AA, "Parado Parado, Policia Militar, Digite /mostrarrg %d!", playerid);
SendClientMessageToAll(0xFFFF00AA, "-----------------|* POLICIA MILITAR *|-------------------");
}
else 
SendClientMessage(playerid, 0xFF0000AA, "[PMESP]{FFFFFF} Voce Nao E Um Policial Militar!");
return 
1;
} 
Reply
#2

PHP Code:
stock ReturnName(playerid)
{
    new 
Nome[24];
    
GetPlayerName(playerid, Nome, 24);
    return 
Nome;
} 
Use ReturnName(id do player)
Reply
#3

Vocк tem que formatar a mensagem e depois usar o SendClientMessageToAll.
Reply
#4

Teste esse ae

Quote:

CMD:m(playerid, params[])
{
if(Profissao[playerid] == Policial)
{
new str[500];
new str2[500];
format(str, sizeof(str), "-----------------|* POLICIA MILITAR *|-------------------\n");
strcat(str2, str);
format(str, sizeof(str), "Parado Parado, Policia Militar, Digite /mostrarrg %d!\n", playerid);
strcat(str2, str);
format(str, sizeof(str), "-----------------|* POLICIA MILITAR *|-------------------");
strcat(str2, str);
SendClientMessageToAll(0xFFFF00AA, str2);
}
else SendClientMessage(playerid, 0xFF0000AA, "[PMESP]{FFFFFF} Voce Nao E Um Policial Militar!");
return 1;
}

Reply
#5

Quote:
Originally Posted by GuiKommander
View Post
PHP Code:
stock ReturnName(playerid)
{
    new 
Nome[24];
    
GetPlayerName(playerid, Nome, 24);
    return 
Nome;
} 
Use ReturnName(id do player)
Quote:
Originally Posted by ipsLuan
View Post
Vocк tem que formatar a mensagem e depois usar o SendClientMessageToAll.
Quote:
Originally Posted by k2bi
View Post
Teste esse ae
PHP Code:
CMD:m(playerid, params[])
{
    if(
Profissao[playerid] == Policial)
    {
        
SendClientMessageToAll(-1, "-----------------|{FFFF00}* POLICIA MILITAR *{FFFFFF}|-------------------");
        
        new 
don[120];
        
format(don,sizeof don, "{FFFF00}Parado Parado, Policia Militar, Digite /mostrarrg %s!", ReturnName(playerid));
        
SendClientMessageToAll(-1, don);
        
        
SendClientMessageToAll(-1, "-----------------|{FFFF00}* POLICIA MILITAR *{FFFFFF}|-------------------");
    }
    else 
SendClientMessage(playerid, 0xFF0000AA, "[PMESP]{FFFFFF} Voce Nao E Um Policial Militar!");
    return 
1;
}
stock ReturnName(playerid)
{
    new 
Nome[24];
    
GetPlayerName(playerid, Nome, 24);
    return 
Nome;
} 
Se eu estiver errado me avise .#Vlw avisar nгo tinha nem reparado
Reply
#6

Otimizando... pq n vai precisar de strcat e nem str de 500 celulas:

PHP Code:
CMD:m(playerid, params[])
{
    new 
string[60];
    if(
Profissao[playerid] == Policial)
    {
        
SendClientMessageToAll(0xFFFF00AA, "-----------------|* POLICIA MILITAR *|-------------------");
        
format(string, sizeof(string), "Parado Parado, Policia Militar, Digite /mostrarrg %d!", playerid);
        
SendClientMessageToAll(0xFFFF00AA, string);
        
SendClientMessageToAll(0xFFFF00AA, "-----------------|* POLICIA MILITAR *|-------------------");
    }
    else 
SendClientMessage(playerid, 0xFF0000AA, "[PMESP]{FFFFFF} Voce Nao E Um Policial Militar!");
    return 
1;
} 
#Edit

Quote:
Originally Posted by Don_Speed
PHP Code:
CMD:m(playerid, params[]) 
{ 
    if(
Profissao[playerid] == Policial) 
    { 
        
SendClientMessageToAll(-1, "-----------------|{FFFF00}* POLICIA MILITAR *{FFFFFF}|-------------------"); 
         
        new 
don[120]; 
        
format(don,sizeof, don, "{FFFF00}Parado Parado, Policia Militar, Digite /mostrarrg %d!", ReturnName(playerid)) 
        
SendClientMessageToAll(-1, don); 
         
        
SendClientMessageToAll(-1, "-----------------|{FFFF00}* POLICIA MILITAR *{FFFFFF}|-------------------"); 
    } 
    else 
SendClientMessage(playerid, 0xFF0000AA, "[PMESP]{FFFFFF} Voce Nao E Um Policial Militar!"); 
    return 
1; 
}
stock ReturnName(playerid) 
{ 
    new 
Nome[24]; 
    
GetPlayerName(playerid, Nome, 24); 
    return 
Nome; 
} 
Se eu estiver errado me avise .
%d e um inteiro e ReturnName e string e tbm falto um ; no format

Reply


Forum Jump:


Users browsing this thread: