Pedido]ajuda afk
#1

Tipo eu achei este afk aki elee fs mas tip que queria que ele ficasse com a tela toda preta condo o player ficar em /afk e ser teleportado para um lugar tipo em lv ,e que apreзa na ccabeca dele um textlabel escrito "player afk" e quando player digitar novamente /afk voltar ara sua posicao de oreigem me ajudem ai ficarei muito grato pela ajuada ajudando na reputacion sua

PHP код:
#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.000000150.000000"~y~Status: ~r~afk");
    
TextDrawBackgroundColor(afk0255);
    
TextDrawFont(afk03);
    
TextDrawLetterSize(afk00.5000003.000000);
    
TextDrawColor(afk0, -1);
    
TextDrawSetOutline(afk02);
    
TextDrawSetProportional(afk01);
    
afk1 TextDrawCreate(10.000000190.000000"digite /afk para sair ou ficar afk.");
    
TextDrawBackgroundColor(afk1255);
    
TextDrawFont(afk13);
    
TextDrawLetterSize(afk10.5000001.000000);
    
TextDrawColor(afk1, -1);
    
TextDrawSetOutline(afk10);
    
TextDrawSetProportional(afk11);
    
TextDrawSetShadow(afk11);
    
TextDrawUseBox(afk11);
    
TextDrawBoxColor(afk1255);
    
TextDrawTextSize(afk1170.00000020.000000);
    
afk2 TextDrawCreate(260.000000120.000000".");
    
TextDrawBackgroundColor(afk2255);
    
TextDrawFont(afk21);
    
TextDrawLetterSize(afk20.70000018.000000);
    
TextDrawColor(afk2255);
    
TextDrawSetOutline(afk20);
    
TextDrawSetProportional(afk21);
    
TextDrawSetShadow(afk21);
    
TextDrawUseBox(afk21);
    
TextDrawBoxColor(afk2255);
    
TextDrawTextSize(afk2470.0000000.000000);
    
afk3 TextDrawCreate(284.000000151.000000"O                 O");
    
TextDrawBackgroundColor(afk3255);
    
TextDrawFont(afk31);
    
TextDrawLetterSize(afk30.5000001.000000);
    
TextDrawColor(afk3, -1);
    
TextDrawSetOutline(afk30);
    
TextDrawSetProportional(afk31);
    
TextDrawSetShadow(afk31);
    
afk4 TextDrawCreate(286.000000217.000000"(~y~------------------)");
    
TextDrawBackgroundColor(afk4255);
    
TextDrawFont(afk41);
    
TextDrawLetterSize(afk40.5000001.000000);
    
TextDrawColor(afk4, -1);
    
TextDrawSetOutline(afk40);
    
TextDrawSetProportional(afk41);
    
TextDrawSetShadow(afk41);
    
afk5 TextDrawCreate(284.000000141.000000"|||              |||");
    
TextDrawBackgroundColor(afk5255);
    
TextDrawFont(afk51);
    
TextDrawLetterSize(afk50.5000001.000000);
    
TextDrawColor(afk5, -65281);
    
TextDrawSetOutline(afk50);
    
TextDrawSetProportional(afk51);
    
TextDrawSetShadow(afk51);
    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(playeridcmdtext[])
{
    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(playeriddialogidresponselistiteminputtext[])
{
    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 em afk",nome);
                    
afk[playerid] = true;
                    
SendClientMessage(playerid,vermelho,"vocк estб afk.");
                    
TogglePlayerControllable(playerid,0);
                    
SetPlayerVirtualWorld(playerid,playerid+1);
                    
SendClientMessageToAll(vermelho,ficouafk);
                    
TextDrawShowForPlayer(playeridafk0);
                    
TextDrawShowForPlayer(playeridafk1);
                    
TextDrawShowForPlayer(playeridafk2);
                    
TextDrawShowForPlayer(playeridafk3);
                    
TextDrawShowForPlayer(playeridafk4);
                    
TextDrawShowForPlayer(playeridafk5);
                }
                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 em afk.",nome);
                    
SendClientMessage(playerid,vermelho,"Nгo estб mais afk.");
                    
afk[playerid] = false;
                    
TogglePlayerControllable(playerid,1);
                    
SetPlayerVirtualWorld(playerid,1);
                    
SendClientMessageToAll(vermelho,saiuafk);
                    
TextDrawHideForPlayer(playeridafk0);
                    
TextDrawHideForPlayer(playeridafk1);
                    
TextDrawHideForPlayer(playeridafk2);
                    
TextDrawHideForPlayer(playeridafk3);
                    
TextDrawHideForPlayer(playeridafk4);
                    
TextDrawHideForPlayer(playeridafk5);
                }
                else
                {
                    
SendClientMessage(playerid,vermelho,"ERRO: Vocк nгo estб afk.");
                    return 
1;
                }
            }
        }
    }
    return 
1;

Reply
#2

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;
}
Crйditos: [KoS]Shickcard e [iPs]Ken
Reply
#3

mas tipo esse ai e ra por no gm mas aond eeu coloc ongamemod?onplayer
Reply
#4

Quote:
Originally Posted by Shickcard
Посмотреть сообщение
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;
}
Crйditos: [KoS]Shickcard e [iPs]Ken
TOPO

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]
;
OnPlayerCommandText
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;
}
FIM DO GAMEMODE

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;
}
Reply
#5

No comeзo do script junto com os outros new's:

pawn Код:
new
     Float: P[3],
     sStr[32 + MAX_PLAYER_NAME],
     Afk[MAX_PLAYERS]
;

Em public OnPlayerCommandText(playerid, cmdtext[]):

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;
}
Em qualquer parte do script, desde que nгo seje dentro de uma public (coloque no final):

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;
}
Atenciosamente,
Falcon.


@edit: Lуs 2 minutos mais rбpido que eu =x
Reply
#6

FAILL OLHA AI
PHP код:
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\2\gamemodes\BGH.pwn(66977) : warning 217loose indentation
C
:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\2\gamemodes\BGH.pwn(66977) : error 029invalid expressionassumed zero
C
:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\2\gamemodes\BGH.pwn(66977) : error 017undefined symbol "HidePlayerChatBubble"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\2\gamemodes\BGH.pwn(66984) : error 030compound statement not closed at the end of file (started at line 66959)
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
6 Errors

Reply
#7

ajuda?
Reply
#8

Final do GM o.O

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)