How to make a AFK System (with back, and with strcmp)
#1

So first we need to know that public OnPlayerCommandText like everyone knows that there are the commands

Do this:

AFK:

Код:
if(strcmp(cmdtext, "/afk", true) == 0)
	{
		TogglePlayerControllable(playerid, 0);
		new string [128];
		new pName[MAX_PLAYER_NAME];
    	       GetPlayerName(playerid, pName, sizeof(pName));
    	       format(string,sizeof string,"%s is afk now (Away From Keyboard).",pName);
    	       SendClientMessageToAll(green, string);
    	       return 1;
    }
BACK:

Код:
if(strcmp(cmdtext, "/back", true) == 0)
    {
   		new string [128];
		new pName[MAX_PLAYER_NAME];
    	        GetPlayerName(playerid, pName, sizeof(pName));
    	        format(string,sizeof string,"%s is back now (Back To KeyBoard).",pName);
    	        SendClientMessageToAll(lightblue, string);
                TogglePlayerControllable(playerid, 1);
		return 1;
	}
There you go it's done :P
Reply


Messages In This Thread
How to make a AFK System (with back, and with strcmp) - by bestr32 - 05.03.2011, 13:33
Re: How to make a AFK System (with back, and with strcmp) - by Stigg - 05.03.2011, 13:44
Re: How to make a AFK System (with back, and with strcmp) - by alpha500delta - 05.03.2011, 13:50

Forum Jump:


Users browsing this thread: 1 Guest(s)