Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- public OnFilterScriptInit()
- {
- for(new i;i<MAX_PLAYERS;i++) {
- if(IsPlayerConnected(i))
- {
- new string[12];
- format(string, sizeof(string), "%d_%d", (random(89)+10), (random(98999)+1000));
- SetPVarString(i, "MaskID", string);
- }
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new string[12];
- format(string, sizeof(string), "%d_%d", (random(89)+10), (random(98999)+1000));
- SetPVarString(playerid, "MaskID", string);
- for(new i=0;i<MAX_PLAYERS;i++)
- if(IsPlayerConnected(i))
- if(GetPVarInt(i, "Masked") == 1)
- ShowPlayerNameTagForPlayer(playerid, i, 0);
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(GetPVarInt(playerid, "Masked") == 1)
- {
- new string[172];
- GetPVarString(playerid, "MaskID", string, sizeof(string));
- format(string, sizeof(string), "[Mask %s]: %s", string, text);
- SendClientMessageToAll(0xFFFFFFAA, string);
- return 0;
- }
- else return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp("/mask", cmdtext, true, 10) == 0)
- {
- if(GetPVarInt(playerid, "Masked") == 0)
- {
- SetPVarInt(playerid, "Masked", true);
- GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~g~You've put a mask on.", 3500, 3);
- for(new i=0;i<MAX_PLAYERS;i++)
- if(IsPlayerConnected(i))
- ShowPlayerNameTagForPlayer(i, playerid, 0);
- }
- else
- {
- SetPVarInt(playerid, "Masked", false);
- GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~r~You've put a mask off.", 3500, 3);
- for(new i=0;i<MAX_PLAYERS;i++)
- if(IsPlayerConnected(i))
- ShowPlayerNameTagForPlayer(i, playerid, 1);
- }
- return 1;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment