02.07.2011, 20:42
This is how it should be.. 
Untested, but this should work. You can learn scripting by spending your time on SAMP Forums/Wiki.
Goodluck!

pawn Код:
#include <a_samp>
#define COLOR_ONE 0xFF0000FF
#define COLOR_TWO 0x00FF00FF
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Mac's AFK System");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
SendMessage(playerid,GREEN, " Loading Mac's AFK System! ");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/AFK", cmdtext, true, 10) == 1)
{
new message[40], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(message,sizeof(message),"%s is now AFK!",name);
SendClientMessage( playerid, COLOR_ONE, message);
return 1;
}
if (strcmp("/BACK", cmdtext, true, 10) == 1)
{
new message[40], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(message,sizeof(message),"%s is now BACK!",name);
SendClientMessage( playerid, COLOR_TWO, message);
return 1;
}
return 0;
}
Goodluck!

