24.02.2010, 08:36
Got bored today so I decided to read the forums and download a few scripts. What I found was that the majority of non roleplay servers didnt have an afk system, so heres a real simple one. Don't point out the problems, I don't care. If I get it wrong, dont blame me, its been a long time since I coded.
Put that in your
pawn Код:
// AFK and back feature by Jonty
// please dont remove this if its a public script, feel free to remove it if your script is private
// afk
if(strcmp(cmdtext, "/afk") == 0) //afk command
{
SetPlayerSpectating(playerid, 1); // I think its setplayerspectating, not sure.
SendClientMessage(playerid, COLOR_HERE, "You are now AFK. Type /back to return.");
return 1;
}
// back
if(strcmp(cmdtext, "/back") == 0) //back command
{
SetPlayerSpectating(playerid, 0); // I think its setplayerspectating, not sure.
SendClientMessage(playerid, COLOR_HERE, "Welcome back!");
return 1;
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])