Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //In cima
- #define COLOR_RED 0xFF0000AA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define DIALOG_PM 1//Cambiate 1 con un ID del Dialog che avete libero nella vostra GM
- new PM;
- //Sotto OnGameModeInit
- PM = 1;
- //Sotto OnPlayerCommandText
- if(strcmp("/nopm",cmdtext,true) == 0)
- {
- new string[128];
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"[ERRORE]Devi essere Admin.");
- if(PM == 1)
- {
- PM = 0;
- format(string,sizeof(string),"L'Admin %s ha disattivato i PM.",PlayerName(playerid));
- SendClientMessageToAll(COLOR_RED,string);
- }
- else
- {
- PM = 1;
- format(string,sizeof(string),"L'Admin %s ha attivato i PM.",PlayerName(playerid));
- SendClientMessageToAll(COLOR_GREEN,string);
- }
- return 1;
- }
- //Sotto OnDialogResponse
- if(dialogid == DIALOG_PM)
- {
- new string[128];
- if(response)
- {
- new clickedplayerid = GetPVarInt(playerid,"ClickedPlayerID");
- format(string,sizeof(string),"PM Inviato a [%d] %s.",clickedplayerid,PlayerName(clickedplayerid));
- SendClientMessage(playerid,COLOR_WHITE,string);
- format(string,sizeof(string),"Testo PM: %s",inputtext);
- SendClientMessage(playerid,COLOR_WHITE,string);
- format(string,sizeof(string),"PM Ricevuto da [%d] %s.",playerid,PlayerName(playerid));
- SendClientMessage(playerid,COLOR_WHITE,string);
- format(string,sizeof(string),"Testo PM: %s",inputtext);
- SendClientMessage(playerid,COLOR_WHITE,string);
- }
- }
- //Sotto OnPlayerClickPlayer
- SetPVarInt(playerid,"ClickedPlayerID",clickedplayerid);
- ShowPlayerDialog(playerid,DIALOG_PM,DIALOG_STYLE_INPUT,"PM","Inserisci il testo da mandare al player selezionato:","Invia","Esci");
- return 1;
- //Fuori da tutto
- PlayerName(playerid)
- {
- new playerName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playerName,sizeof(playerName));
- return playerName;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement