19.09.2011, 05:24
pawn Код:
#if defined MAX_PLAYERS
#undef MAX_PLAYERS
#define MAX_PLAYERS 50
#endif
pawn Код:
new
Float: P[3],
sStr[32 + MAX_PLAYER_NAME],
Afk[MAX_PLAYERS]
;
pawn Код:
if(strcmp("/afk", cmdtext, true) == 0)
{
if(Afk[playerid] == 0)
{
format(sStr, sizeof(sStr), "[AFK-MODE] {E31919}%s[%i] estб agora {C9C9C9}AFK!", Nome, playerid);
SendClientMessage(playerid, 0xFFFFFFAA, sStr);
GetPlayerPos(playerid, P[0], P[1], P[2]);
SetPlayerPos(playerid, 0.0, 0.0, 0.0);
SetPlayerChatBubble(playerid, "* Player AFK *", 0xFF0000FF, 100.0, 10000);
SendClientMessage(playerid, 0xFFFFFFAA, "Vocк agora estб {C9C9C9}AFK!");
TogglePlayerControllable(playerid, 0);
Afk[playerid] = 1;
}
else if(Afk[playerid] == 1)
{
format(sStr, sizeof(sStr), "[AFK-MODE] {E31919}%s[%i] estб agora em {FF00FF}Modo Game!", Nome, playerid);
SendClientMessage(playerid, 0xFFFFFFAA, sStr);
SetPlayerPos(playerid, P[0], P[1], P[2]);
HidePlayerChatBubble(playerid);
SendClientMessage(playerid, 0xFFFFFFAA, "Vocк agora estб em {FF00FF}Modo Game!");
TogglePlayerControllable(playerid, 1);
Afk[playerid] = 0;
}
return 1;
}
pawn Код:
stock HidePlayerChatBubble(playerid)
{
new bolha[10],x = 0;
while(x < sizeof(bolha)) bolha[x] = '\0',x++;
SetPlayerChatBubble(playerid, bolha, 0xFF0000FF, 100.0, true);
return 1;
}