pawn Код:
#include a_samp
#define vermelho 0xFF0000FF
#define MAXPLAYERS 50
new
Text:afk0,
Text:afk1,
Text:afk2,
Text:afk3,
Text:afk4,
Text:afk5,
bool:afk[MAXPLAYERS]
;
public OnFilterScriptInit()
{
afk0 = TextDrawCreate(37.000000, 150.000000, "~y~Status: ~r~afk");
TextDrawBackgroundColor(afk0, 255);
TextDrawFont(afk0, 3);
TextDrawLetterSize(afk0, 0.500000, 3.000000);
TextDrawColor(afk0, -1);
TextDrawSetOutline(afk0, 2);
TextDrawSetProportional(afk0, 1);
afk1 = TextDrawCreate(10.000000, 190.000000, "digite /afk para sair ou ficar afk.");
TextDrawBackgroundColor(afk1, 255);
TextDrawFont(afk1, 3);
TextDrawLetterSize(afk1, 0.500000, 1.000000);
TextDrawColor(afk1, -1);
TextDrawSetOutline(afk1, 0);
TextDrawSetProportional(afk1, 1);
TextDrawSetShadow(afk1, 1);
TextDrawUseBox(afk1, 1);
TextDrawBoxColor(afk1, 255);
TextDrawTextSize(afk1, 170.000000, 20.000000);
afk2 = TextDrawCreate(260.000000, 120.000000, ".");
TextDrawBackgroundColor(afk2, 255);
TextDrawFont(afk2, 1);
TextDrawLetterSize(afk2, 0.700000, 18.000000);
TextDrawColor(afk2, 255);
TextDrawSetOutline(afk2, 0);
TextDrawSetProportional(afk2, 1);
TextDrawSetShadow(afk2, 1);
TextDrawUseBox(afk2, 1);
TextDrawBoxColor(afk2, 255);
TextDrawTextSize(afk2, 470.000000, 0.000000);
afk3 = TextDrawCreate(284.000000, 151.000000, "O O");
TextDrawBackgroundColor(afk3, 255);
TextDrawFont(afk3, 1);
TextDrawLetterSize(afk3, 0.500000, 1.000000);
TextDrawColor(afk3, -1);
TextDrawSetOutline(afk3, 0);
TextDrawSetProportional(afk3, 1);
TextDrawSetShadow(afk3, 1);
afk4 = TextDrawCreate(286.000000, 217.000000, "(~y~------------------)");
TextDrawBackgroundColor(afk4, 255);
TextDrawFont(afk4, 1);
TextDrawLetterSize(afk4, 0.500000, 1.000000);
TextDrawColor(afk4, -1);
TextDrawSetOutline(afk4, 0);
TextDrawSetProportional(afk4, 1);
TextDrawSetShadow(afk4, 1);
afk5 = TextDrawCreate(284.000000, 141.000000, "||| |||");
TextDrawBackgroundColor(afk5, 255);
TextDrawFont(afk5, 1);
TextDrawLetterSize(afk5, 0.500000, 1.000000);
TextDrawColor(afk5, -65281);
TextDrawSetOutline(afk5, 0);
TextDrawSetProportional(afk5, 1);
TextDrawSetShadow(afk5, 1);
return 1;
}
public OnFilterScriptExit()
{
TextDrawHideForAll(afk0);
TextDrawDestroy(afk0);
TextDrawHideForAll(afk1);
TextDrawDestroy(afk1);
TextDrawHideForAll(afk2);
TextDrawDestroy(afk2);
TextDrawHideForAll(afk3);
TextDrawDestroy(afk3);
TextDrawHideForAll(afk4);
TextDrawDestroy(afk4);
TextDrawHideForAll(afk5);
TextDrawDestroy(afk5);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/afk",true) == 0)
{
ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"Afk","Ficar AFK\nSair AFK","ok","sair");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9999)
{
if(response == 1)
{
if(listitem == 0)
{
if(afk[playerid] == false)
{
new ficouafk[30],nome[24];
GetPlayerName(playerid,nome,sizeof(nome));
format(ficouafk,sizeof(ficouafk),"O jogador %s ficou afk",nome);
afk[playerid] = true;
SendClientMessage(playerid,vermelho,"vocк estб afk.");
TogglePlayerControllable(playerid,0);
SetPlayerVirtualWorld(playerid,playerid+1);
SendClientMessageToAll(vermelho,ficouafk);
TextDrawShowForPlayer(playerid, afk0);
TextDrawShowForPlayer(playerid, afk1);
TextDrawShowForPlayer(playerid, afk2);
TextDrawShowForPlayer(playerid, afk3);
TextDrawShowForPlayer(playerid, afk4);
TextDrawShowForPlayer(playerid, afk5);
}
else
{
SendClientMessage(playerid,vermelho,"ERRO: Vocк jб estб afk.");
return 1;
}
}
if(listitem == 1)
{
if(afk[playerid] == true)
{
new saiuafk[40],nome[24];
GetPlayerName(playerid,nome,sizeof(nome));
format(saiuafk,sizeof(saiuafk),"O jogador %s nгo estб mais afk.",nome);
SendClientMessage(playerid,vermelho,"Nгo estб mais afk.");
afk[playerid] = false;
TogglePlayerControllable(playerid,1);
SetPlayerVirtualWorld(playerid,1);
SendClientMessageToAll(vermelho,saiuafk);
TextDrawHideForPlayer(playerid, afk0);
TextDrawHideForPlayer(playerid, afk1);
TextDrawHideForPlayer(playerid, afk2);
TextDrawHideForPlayer(playerid, afk3);
TextDrawHideForPlayer(playerid, afk4);
TextDrawHideForPlayer(playerid, afk5);
}
else
{
SendClientMessage(playerid,vermelho,"ERRO: Vocк nгo estб afk.");
return 1;
}
}
}
}
return 1;
}
tem o do willian tambem...
... eu procurei e achei.