How i can make...
#1

How i can make a command for call the 911?

like /911 and a dialog who show select;

Police or Fire dept than comunicate the location and the message and send a dispatch to all the peoples who have cop skins (in case of police9 and fd skins (in case of fd) ?
like [dispatch] we've got a (message here) in (location here)
Reply
#2

First, make a command, which will show the dialog, and it will be a DIALOG_STYLE_LIST. Then make responses for every listitem and make the script.

https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog
Reply
#3

ok i made the dialog:
Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/911", true))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "911 Emergency what service you need?", "Police\nFire Dept", "Call", "Cancel");

return 1;
}

return 0;
}

How i can now send a message to PD if select Police and FD if select FD?

Quote:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
{
switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
case 1:// Our dialog!
{
switch(listitem)// Checking which listitem was selected
{
case 0:// The first item listed
{
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "[INFO]Type your message and the location.");
GivePlayerMoney(playerid, -0);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
}
case 1: // The second item listed
{
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "[INFO]Type your message and the location.");
GivePlayerMoney(playerid, 02);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
}

}
}
}
}
return 1;

Reply
#4

Use this stock:

pawn Код:
stock SendMessageToCops(color,text[])
{
   for(new i=0; i<MAX_PLAYERS; i++)
   {
      if(IsPlayerConnected(i))
      {
         if(GetPlayerSkin(playerid) == (280 || 281 || 282 || 283 || 265 || 266 || 267))
         {
            SendClientMessage(i,color,text);
         }
      }
   }
}
So in your dialog response script, it should look like this:

pawn Код:
SendMessageToCops(COLOR, MESSAGE);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)