Jump to content
  • 0

Afk system intrebare


eXtreMe96

Question

9 answers to this question

Recommended Posts

Adauga in gm new AfkTag[MAX_PLAYERS];

Apoi dute la comanda /afk si adauga asta

new name[MAX_PLAYER_NAME];
				GetPlayerName(playerid,name,MAX_PLAYER_NAME);
				new setname[16];
				format(setname, sizeof(setname), "%s[AFK]",name);
				if(!strlen(name[11]))
				{
					AfkTag[playerid] = 1;
					SetPlayerName(playerid,setname);
				}
Iar la /back
new pname[16];
				GetPlayerName(playerid,pname,16);
				strdel(pname, strlen(pname)-5, strlen(pname));
				if(AfkTag[playerid] == 1)
				{
					AfkTag[playerid] = 0;
					SetPlayerName(playerid,pname);
				}

i0418xcttya707ofg.jpg

Link to comment
Share on other sites

Adauga in gm new AfkTag[MAX_PLAYERS];

Apoi dute la comanda /afk si adauga asta

new name[MAX_PLAYER_NAME];
				GetPlayerName(playerid,name,MAX_PLAYER_NAME);
				new setname[16];
				format(setname, sizeof(setname), "%s[AFK]",name);
				if(!strlen(name[11]))
				{
					AfkTag[playerid] = 1;
					SetPlayerName(playerid,setname);
				}
Iar la /back
new pname[16];
				GetPlayerName(playerid,pname,16);
				strdel(pname, strlen(pname)-5, strlen(pname));
				if(AfkTag[playerid] == 1)
				{
					AfkTag[playerid] = 0;
					SetPlayerName(playerid,pname);
				}

Ce bine copiezi din GM tau.

Nu e bine sa pui [AFK] in fata numelui, ca stiu unii cum sa crashuieze serverul cu "[AFK]"-ul asta.

Link to comment
Share on other sites

Am alta intrebare Am facut asa pentru afk

 

 if (strcmp("/afk", cmdtext, true, 10) == 0)
        {
        if(Afk[playerid]==0){
        Afk[playerid]=1;
        TogglePlayerControllable(playerid,0);
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerid) + 50);
        Timer[playerid] = SetTimer("SendMessage",100,0);
		TogglePlayerControllable(playerid,0);
        format(string, sizeof(string), "%s Este afk", Name);
        SendClientMessageToAll(0x33CCFFAA, string);
		}else{SendClientMessage(playerid,0xFF4500AA, "Server:Esti deja afk!");}
        return 1;
        }
Si asa pentru brb
if (strcmp("/brb", cmdtext, true, 10) == 0)
        {
        if(Brb[playerid]==0){
        Brb[playerid]=1;
        Timer2[playerid] = SetTimer("SendMessage",100,0);
		TogglePlayerControllable(playerid,0);
        format(string, sizeof(string), "%s Este Brb", Name);
        SendClientMessageToAll(0x33CCFFAA, string);
		}else{SendClientMessage(playerid,0xFF4500AA, "Server:Esti deja brb!");}
        return 1;
        }

Si puteti sa ma ajutati sa fac back ca nustiu cum  :o

lol

Link to comment
Share on other sites

Ia vezi e bine cum l-am facut ca nu l-am testat ...

if (strcmp("/back", cmdtext, true, 10) == 0)

{

    if(AFK[playerid] == 1)

{

    TogglePlayerControllable(playerid,1);

    SetPlayerColor(playerid,oldColor[playerid]);

    PlayerInfo[playerid][pMuted] = 0;

    SendClientMessage(playerid, COLOR_YELLOW, " You are in back in game !");

    AFK[playerid] = 0;

}

else

{ }

}

16189165.gifrastamaunbydeejaylobo1.gifsmileysw0181.gif

xmsok6ay41.gif

Link to comment
Share on other sites

Joint , ai copiat si tu din GM tau .. de unde ai scos tu oldColor[playerid]... iti imaginezi ca o sa-i dea eroare la compile fiindca el nu are new oldcolor[MAX_PLAYERS], nu ?

Mai zici ca ai facut-o pe loc si n-ai testat..

U dupa ce ca esti planta mai si postezi taci ca esti .... ce te bagi u  ?

Eu am facut back dupa cum stiu eu

Daca nu are adauga =)) lol ce paralel esti

16189165.gifrastamaunbydeejaylobo1.gifsmileysw0181.gif

xmsok6ay41.gif

Link to comment
Share on other sites

Nu va sfaditi ca ce sunt asa de prost parca nu pot shimba variabilel jo!nt merge da doar pentru afk dar imi trebuie deodata sa merga back si la brb impreuna

Uite asa:

if (strcmp("/back", cmdtext, true, 10) == 0)
   {
       if(AFK[playerid] == 1)
      {
          TogglePlayerControllable(playerid,1);
          SetPlayerColor(playerid,oldColor[playerid]);
          PlayerInfo[playerid][pMuted] = 0;
          SendClientMessage(playerid, COLOR_YELLOW, " You are in back in game !");
          AFK[playerid] = 0;
      }
       if(Brb[playerid] == 1)
      {
          TogglePlayerControllable(playerid,1);
          SetPlayerColor(playerid,oldColor[playerid]);
          PlayerInfo[playerid][pMuted] = 0;
          SendClientMessage(playerid, COLOR_YELLOW, " You are in back in game !");
          Brb[playerid] = 0;
      }
   }

Si pune new oldColor[MAX_PLAYERS]; sus in script ;)

142sj0l.png

Underground-GFX

Link to comment
Share on other sites

C:\Documents and Settings\eXtreMe\??????? ????\????? ????? (3)\filterscripts\afk-1.pwn(98) : warning 215: expression has no effect
C:\Documents and Settings\eXtreMe\??????? ????\????? ????? (3)\filterscripts\afk-1.pwn(98) : error 001: expected token: ";", but found "["
C:\Documents and Settings\eXtreMe\??????? ????\????? ????? (3)\filterscripts\afk-1.pwn(98) : error 029: invalid expression, assumed zero
C:\Documents and Settings\eXtreMe\??????? ????\????? ????? (3)\filterscripts\afk-1.pwn(98) : warning 215: expression has no effect
C:\Documents and Settings\eXtreMe\??????? ????\????? ????? (3)\filterscripts\afk-1.pwn(98) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\eXtreMe\??????? ????\????? ????? (3)\filterscripts\afk-1.pwn(98) : fatal error 107: too many error messages on one line

Rindul 98          PlayerInfo[playerid][pMuted] = 0;

lol

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.