Advertisement
Guest User

Click PM System By peppinux aka Peppe_Stasu

a guest
Aug 17th, 2010
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.88 KB | None | 0 0
  1. //In cima
  2. #define COLOR_RED 0xFF0000AA
  3. #define COLOR_GREEN 0x33AA33AA
  4. #define COLOR_WHITE 0xFFFFFFAA
  5.  
  6. #define DIALOG_PM 1//Cambiate 1 con un ID del Dialog che avete libero nella vostra GM
  7.  
  8. new PM;
  9.  
  10. //Sotto OnGameModeInit
  11. PM = 1;
  12.  
  13. //Sotto OnPlayerCommandText
  14.     if(strcmp("/nopm",cmdtext,true) == 0)
  15.     {
  16.         new string[128];
  17.         if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"[ERRORE]Devi essere Admin.");
  18.         if(PM == 1)
  19.         {
  20.             PM = 0;
  21.             format(string,sizeof(string),"L'Admin %s ha disattivato i PM.",PlayerName(playerid));
  22.             SendClientMessageToAll(COLOR_RED,string);
  23.         }
  24.         else
  25.         {
  26.             PM = 1;
  27.             format(string,sizeof(string),"L'Admin %s ha attivato i PM.",PlayerName(playerid));
  28.             SendClientMessageToAll(COLOR_GREEN,string);
  29.         }
  30.         return 1;
  31.     }
  32.  
  33. //Sotto OnDialogResponse
  34.     if(dialogid == DIALOG_PM)
  35.     {
  36.         new string[128];
  37.         if(response)
  38.         {
  39.             new clickedplayerid = GetPVarInt(playerid,"ClickedPlayerID");
  40.             format(string,sizeof(string),"PM Inviato a [%d] %s.",clickedplayerid,PlayerName(clickedplayerid));
  41.             SendClientMessage(playerid,COLOR_WHITE,string);
  42.             format(string,sizeof(string),"Testo PM: %s",inputtext);
  43.             SendClientMessage(playerid,COLOR_WHITE,string);
  44.             format(string,sizeof(string),"PM Ricevuto da [%d] %s.",playerid,PlayerName(playerid));
  45.             SendClientMessage(playerid,COLOR_WHITE,string);
  46.             format(string,sizeof(string),"Testo PM: %s",inputtext);
  47.             SendClientMessage(playerid,COLOR_WHITE,string);
  48.         }
  49.     }
  50.  
  51. //Sotto OnPlayerClickPlayer
  52.     SetPVarInt(playerid,"ClickedPlayerID",clickedplayerid);
  53.     ShowPlayerDialog(playerid,DIALOG_PM,DIALOG_STYLE_INPUT,"PM","Inserisci il testo da mandare al player selezionato:","Invia","Esci");
  54.     return 1;
  55.  
  56. //Fuori da tutto
  57. PlayerName(playerid)
  58. {
  59.     new playerName[MAX_PLAYER_NAME];
  60.     GetPlayerName(playerid,playerName,sizeof(playerName));
  61.     return playerName;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement