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; } |
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; |
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);
}
}
}
}
SendMessageToCops(COLOR, MESSAGE);