Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #include <sscanf>
- #define COLOREWT 0x00E2F6AA
- #define VERDE 0x00F600AA
- #define ROSSO 0xF60000AA
- new bool:WTState[MAX_PLAYERS] = false; // Se è uguale a false significa che è spento, invece se è true, è acceso.
- new CanaleWT[MAX_PLAYERS];//Canale WT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- WTState[playerid] = false;
- CanaleWT[playerid] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- return 0;
- }
- CMD:accendiwt(playerid, params[])
- {
- if(WTState[playerid] == false)
- {
- WTState[playerid] = true;
- CanaleWT[playerid] = 0;
- SendClientMessage(playerid, VERDE, "Hai acceso il tuo WT, usa /i per parlare.");
- }
- else if(WTState[playerid] == true)
- {
- WTState[playerid] = false;
- SendClientMessage(playerid, VERDE, "Hai spento il tuo WT, usa /accendiwt per accenderlo.");
- }
- return 1;
- }
- CMD:i(playerid, params[])
- {
- new MWT[128], stringa[128], Nome[24];
- if(sscanf(params, "s", MWT))return SendClientMessage(playerid, ROSSO, "/i [Messaggio]");
- if(WTState[playerid] == false)return SendClientMessage(playerid, ROSSO, "Il tuo WT è spento");
- for(new i = 0; i<MAX_PLAYERS; i++)
- {
- if(CanaleWT[i] == CanaleWT[playerid] && WTState[i] == true)
- {
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(stringa, sizeof(stringa), "[WT] %s dice: %s", Nome, MWT);
- SendClientMessage(i, COLOREWT, stringa);
- }
- }
- return 1;
- }
- CMD:canalewt(playerid, params[])
- {
- new Canale, stringa[128], Nome[24];
- if(sscanf(params, "d", Canale))return SendClientMessage(playerid, ROSSO, "/canalewt [IdCanale]");
- if(Canale == CanaleWT[playerid])return SendClientMessage(playerid, ROSSO, "Sei già in questo canale");
- if(WTState[playerid] == false)return SendClientMessage(playerid, ROSSO, "Il tuo WT è spento");
- CanaleWT[playerid] = Canale;
- format(stringa, sizeof(stringa), "Hai cambiato il canale WT in %d", Canale);
- SendClientMessage(playerid, VERDE, stringa);
- for(new i = 0; i<MAX_PLAYERS; i++)
- {
- if(CanaleWT[i] == Canale)
- {
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(stringa, sizeof(stringa), "%s è entrato nel canale", Nome);
- SendClientMessage(i, VERDE, stringa);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement