911 phone help
#1

Hi all,i have make a dialog but how i can send a message to the all medic team and not to all players only to spesific skin,for example send a message only to skin 275(medic)
PHP код:
    if(dialogid == DIALOG_EMPHONE)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
            new 
name[MAX_PLAYER_NAME], string[48];
                   
GetPlayerName(playeridnamesizeof(name));
                 
format(stringsizeof(string), " %s Called a medic.Closest unit respond."name );
                  
SendClientMessageToAll(-1string);
            }
            if(
listitem == 1)
            {
             new 
name[MAX_PLAYER_NAME], string[48];
                   
GetPlayerName(playeridnamesizeof(name));
                 
format(stringsizeof(string), " %s Called the police.Closest units respond."name );
                  
SendClientMessageToAll(-1string);
            }
            if(
listitem == 2)
            {
             new 
name[MAX_PLAYER_NAME], string[48];
                   
GetPlayerName(playeridnamesizeof(name));
                 
format(stringsizeof(string), " %s Called the Fire Dept.Closest units respond."name );
                  
SendClientMessageToAll(-1string);
            }
        }
        return 
1;
    } 
Reply
#2

someone
Reply
#3

in this case you have to loop it...for example
pawn Код:
new name[MAX_PLAYER_NAME], string[48];
                   GetPlayerName(playerid, name, sizeof(name));
                 format(string, sizeof(string), " %s Called a medic.Closest unit respond.", name );
                  for(new i = 0; i ! = MAX_PLAYERS;i ++)
                   {
                          if(GetPlayerSkin(i) == 275) return SendClientMessage(i,-1,string);
                   }
you can use it and replace for police, and Fire dept , only editing instead of this
Код:
    format(string, sizeof(string), " %s Called a medic.Closest unit respond.", name );
this
Код:
           format(string, sizeof(string), " Your message,",name);
and instead of
Код:
if(GetPlayerSkin(i) == 275) return SendClientMessage(i,-1,string);
this
Код:
if(GetPlayerSkin(i) == yourskin) return SendClientMessage(i,-1,string);
Reply
#4

ok,thanks,gonna test it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)