[Ajuda] SMS para admins verem
#1

pawn Код:
new PMName[32];
            new ENName[32];
            GetPlayerName(playerid,PMName[0],32);
            GetPlayerName(gPMDestinationID[playerid],ENName[0],32);
            new message[196];
            format(message,sizeof(message),"%s ID:%d Torpedгo:\n%s",PMName[0],playerid, inputtext);
            SendClientMessage(gPMDestinationID[playerid],0xaaffaaff,message);
            format(message,sizeof(message),"Torpedгo enviado a %s, gasto 1 Creditos.",ENName);
            SendClientMessage(playerid,COLOR_CV,message);
            PlayerInfo[playerid][pCreditos] -= 1;
pawn Код:
MensagemAdmin(Admin,string,1);
queria adicionar para os admins verem.
Reply
#2

Loop para os players que possuam admin e dentro dele, vocк pхe a mensagem que й exibida pro destinatбrio.
Reply
#3

PHP код:
CMD:sendsms(playeridparams[])
{
    new 
PMName[MAX_PLAYER_NAME], ENName[MAX_PLAYER_NAME], message[196];
    if(!
strlen(params))
        return 
SendClientMessage(playerid, -1"USE: /sendsms texto");
    
GetPlayerName(playeridPMNamesizeof PMName);
    
GetPlayerName(gPMDestinationID[playerid], ENNamesizeof ENName);
     
format(messagesizeof(message), "%s ID:%d Torpedгo:\n%s"PMName[0], playeridinputtext);
     
SendClientMessage(gPMDestinationID[playerid], 0xaaffaaffmessage);
     
format(messagesizeof(message), "Torpedгo enviado a %s, gasto 1 Creditos."ENName);
     
SendClientMessage(playerid,COLOR_CV,message);
      
PlayerInfo[playerid][pCreditos] -= 1;
    for(new 
i=0MAX_PLAYERSi++)
    {
        if(
Player[i][Admin] >= 1)
        {
            
SendClientMessage(i0xaaffaaffmessage);
        }
    }
    return 
1;

Reply
#4

nгo fuincionou amigo, ele envia

Код:
 "Torpedгo enviado a %s, gasto 1 Creditos."
para o admin..

nao oque ele enviou..
Reply
#5

Tente dessa forma

PHP код:
CMD:sendsms(playeridparams[]) 

    if(!
strlen(params)) 
        return 
SendClientMessage(playerid, -1"USE: /sendsms texto"); 
        
    if(
PlayerInfo[playerid][pCreditos] == 0//Se nгo verificar os crйditos, ele poderб mandar sms infinito
        
return SendClientMessage(playerid, -1"Vocк nгo possui Crйditos.");
        
    if(!
IsPlayerConnected(gPMDestinationID[playerid]) || gPMDestinationID[playerid] == INVALID_PLAYER_ID)    
        return 
SendClientMessage(playerid, -1"Destino invбlido ou nгo estб conectado.");
        
    new 
PMName[MAX_PLAYER_NAME], ENName[MAX_PLAYER_NAME], message[196]; 
    
GetPlayerName(playeridPMNamesizeof PMName); 
    
GetPlayerName(gPMDestinationID[playerid], ENNamesizeof ENName); 
    
format(messagesizeof(message), "%s ID:%d Torpedгo:\n%s"PMNameplayeridstrlen(params)); 
    
SendClientMessage(gPMDestinationID[playerid], 0xaaffaaffmessage);
    for(new 
i!= MAX_PLAYERSi++) 
        if(
IsPlayerConnected(i) && Player[i][Admin] > 0SendClientMessage(i0xaaffaaffmessage); 
    
format(messagesizeof(message), "Torpedгo enviado a %s, gasto 1 Creditos."ENName); 
    
SendClientMessage(playerid,COLOR_CV,message); 
    
    
PlayerInfo[playerid][pCreditos] -= 1;
    return 
1

Reply
#6

Quote:
Originally Posted by EditPawn
Посмотреть сообщение
Tente dessa forma

PHP код:
CMD:sendsms(playeridparams[]) 

    if(!
strlen(params)) 
        return 
SendClientMessage(playerid, -1"USE: /sendsms texto"); 
        
    if(
PlayerInfo[playerid][pCreditos] == 0//Se nгo verificar os crйditos, ele poderб mandar sms infinito
        
return SendClientMessage(playerid, -1"Vocк nгo possui Crйditos.");
        
    if(!
IsPlayerConnected(gPMDestinationID[playerid]) || gPMDestinationID[playerid] == INVALID_PLAYER_ID)    
        return 
SendClientMessage(playerid, -1"Destino invбlido ou nгo estб conectado.");
        
    new 
PMName[MAX_PLAYER_NAME], ENName[MAX_PLAYER_NAME], message[196]; 
    
GetPlayerName(playeridPMNamesizeof PMName); 
    
GetPlayerName(gPMDestinationID[playerid], ENNamesizeof ENName); 
    
format(messagesizeof(message), "%s ID:%d Torpedгo:\n%s"PMNameplayeridstrlen(params)); 
    
SendClientMessage(gPMDestinationID[playerid], 0xaaffaaffmessage);
    for(new 
i!= MAX_PLAYERSi++) 
        if(
IsPlayerConnected(i) && Player[i][Admin] > 0SendClientMessage(i0xaaffaaffmessage); 
    
format(messagesizeof(message), "Torpedгo enviado a %s, gasto 1 Creditos."ENName); 
    
SendClientMessage(playerid,COLOR_CV,message); 
    
    
PlayerInfo[playerid][pCreditos] -= 1;
    return 
1

bom amigo, testei seu cod e da erro..
fica assim

quando o player й admin, ele envia 2 mensagens

Код:
 "%s ID:%d Torpedгo:\n%s",
"%s ID:%d Torpedгo:\n%s"
e nгo aparece pro admin no caso..
se puder ajudar..
Reply
#7

Eu nгo entendi qual й a finalidade que vocк quer para esse comando.

Vocк quer que envie o torpedo ao "gPMDestinationID[playerid]" e envie tambйm ao admin? Ou a prуpria variбvel jб estб armazenando o id do admin ?

Fiz o comando utilizando id que o jogador digitar no comando, agora sу adaptar a funзгo que vocк deseja.

PHP код:
CMD:sendsms(playeridparams[])  
{  
    new 
idtexto[90];
    if(
sscanf(params"us[90]"idtexto))
        return 
SendClientMessage(playerid, -1"USE: /sendsms id texto");
        
    if(
PlayerInfo[playerid][pCreditos] == 0)  
        return 
SendClientMessage(playerid, -1"Vocк nгo possui Crйditos."); 
         
    if(
id == INVALID_PLAYER_ID)     
        return 
SendClientMessage(playerid, -1"Este jogador nгo estб conectado."); 
    new 
playeridName[20], idName[20], String[128];
    
    
GetPlayerName(playeridplayeridName20);
    
GetPlayerName(ididName20);
    
    
format(String128"%s ID:%i Torpedгo: %s"playeridNameplayeridtexto);
    
SendClientMessage(id, -1String); //Envia a mensagem ao id que foi digitado
    
for(new i!= MAX_PLAYERSi++)
        if(
IsPlayerConnected(i) && IsPlayerAdmin(i)) SendClientMessage(i, -1String); //Envia a mesma mensagem a todos os admins online
        
    
PlayerInfo[playerid][pCreditos]--;
    
format(String128"Torpedгo enviado a %s, gasto 1 Crйditos. Seus Crйditos: %i."idNamePlayerInfo[playerid][pCreditos]);
    
SendClientMessage(playerid, -1String);
    return 
1;

Reply
#8

Quote:
Originally Posted by EditPawn
Посмотреть сообщение
Eu nгo entendi qual й a finalidade que vocк quer para esse comando.

Vocк quer que envie o torpedo ao "gPMDestinationID[playerid]" e envie tambйm ao admin? Ou a prуpria variбvel jб estб armazenando o id do admin ?

Fiz o comando utilizando id que o jogador digitar no comando, agora sу adaptar a funзгo que vocк deseja.
Bom, й que no meu servidor, muitos estao divulgando por sms, sу que nao pelo sms de comando, mas aquele de dialog que clica duas vezes no nome etal.

quero colocar pra tudo que enviarem ali, apareзa pra admin.. entende? e nao consigo.
esse cod que mandou resolveria?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)