911 phone help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: 911 phone help (
/showthread.php?tid=360310)
911 phone help -
jimis - 17.07.2012
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(playerid, name, sizeof(name));
format(string, sizeof(string), " %s Called a medic.Closest unit respond.", name );
SendClientMessageToAll(-1, string);
}
if(listitem == 1)
{
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), " %s Called the police.Closest units respond.", name );
SendClientMessageToAll(-1, string);
}
if(listitem == 2)
{
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), " %s Called the Fire Dept.Closest units respond.", name );
SendClientMessageToAll(-1, string);
}
}
return 1;
}
Re: 911 phone help -
jimis - 17.07.2012
someone
Re: 911 phone help -
XStormiest - 17.07.2012
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);
Re: 911 phone help -
jimis - 17.07.2012
ok,thanks,gonna test it