Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnGameModeInit()
- {
- SetTimer("Timer_UpdateTags", 10000, 1);
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- // Use isso ao inves de SetPlayerChatBubble, dessa
- // forma vai manter o texto e a tag ao mesmo tempo
- SetPlayerHeadChat(playerid, text, 10.0, 5);
- return 1;
- }
- // ----
- new UsingChat[MAX_PLAYERS];
- forward void:Timer_UpdateTags();
- public void:Timer_UpdateTags()
- {
- foreach(pid : Player)
- {
- if(UsingChat[pid] > gettime()) continue
- switch(pinfo[pid][admin])
- {
- case 1: SetPlayerChatBubble(playerid, "Helper", 0xFFFF00FF, 10.0, 10000);
- case 2: SetPlayerChatBubble(playerid, "Moder", 0x008000FF, 10.0, 10000);
- case 3: SetPlayerChatBubble(playerid, "Admin", 0x00CAFFFF, 10.0, 10000);
- default: SetPlayerChatBubble(playerid, "Player", 0xFF7F00FF, 10.0, 10000);
- }
- }
- }
- SetPlayerHeadChat(playerid, const text[], Float:range, second)
- {
- static mytext[144];
- switch(pinfo[pid][admin])
- {
- case 1: format(mytext, sizeof mytext, "{FFFF00}Helper\n{FFFFFF}");
- case 2: format(mytext, sizeof mytext, "{008000}Moder\n{FFFFFF}");
- case 3: format(mytext, sizeof mytext, "{00CAFF}Admin\n{FFFFFF}");
- default: format(mytext, sizeof mytext, "{FF7F00}Player\n{FFFFFF}");
- }
- strcat(mytext, text);
- UsingChat[playerid] = (gettime() + second);
- return SetPlayerChatBubble(playerid, mytext, -1, range, (second * 1000));
- }
- CMD:setadmin(playerid, params[])
- {
- new pid, nivel;
- if(sscanf(params, "dd", pid, nivel))
- SendClientMessage(playerid, -1, "Use: /setadmin [playerid] [nivel]");
- else
- {
- if(!IsPlayerConnected(pid))
- SendClientMessage(playerid, -1, "| Admin | Jogador nao encontrado");
- else
- {
- nivel = clamp(nivel, 0, 6);
- pinfo[pid][admin] = nivel;
- SendClientMessage(playerid, -1, "| Admin | Jogador setado com sucesso");
- SendClientMessage(pid, -1, "| Info | Voce foi setado por um admin");
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement