21.06.2012, 01:30
Ok i made an afk System but I Run a Roleplay server so it Must be RP Now my idea is To turn a timer on my AFK system
So when a player Write down /afk He will have to stand Still No move, And wait 60 Seconds then he might Turn afk ,
So couldy anybody Add that 60 seconds and No move for me? the lines
PS. this if for admin now but will be For regular players later
So when a player Write down /afk He will have to stand Still No move, And wait 60 Seconds then he might Turn afk ,
So couldy anybody Add that 60 seconds and No move for me? the lines
PHP код:
if (strcmp(cmd, "/aafk", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(AFK[playerid] == 0)
{
if(!IsPlayerInAnyVehicle(playerid))
{
GetPlayerPos(playerid,TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
SafeSetPlayerPos(playerid, 0,0,2500);
}
else
{
GetVehiclePos(idcar, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
SetVehiclePos(GetPlayerVehicleID(playerid), 0,0,2500);
}
afkadmins ++;
AFK[playerid] = 1;
TogglePlayerControllable(playerid, 0);
TextDrawShowForPlayer(playerid, Textdraw5);
TextDrawShowForPlayer(playerid, Textdraw50);
TextDrawHideForPlayer(playerid, Textdraw44);
TextDrawHideForPlayer(playerid, Textdraw45);
TextDrawHideForPlayer(playerid, Textdraw55);
TextDrawHideForPlayer(playerid, Textdraw49[playerid]);
TextDrawHideForPlayer(playerid, Textdraw51[playerid]);
if(PlayerInfo[playerid][pWatch] == 1)
{
TextDrawHideForPlayer(playerid, Textdraw56);
TextDrawHideForPlayer(playerid, Textdraw57);
TextDrawHideForPlayer(playerid, Textdraw58);
}
}
else
{
if(!IsPlayerInAnyVehicle(playerid)) SafeSetPlayerPos(playerid, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
else SetVehiclePos(idcar, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
afkadmins --;
AFK[playerid] = 0;
TogglePlayerControllable(playerid, 1);
TextDrawHideForPlayer(playerid, Textdraw5);
TextDrawHideForPlayer(playerid, Textdraw50);
TextDrawShowForPlayer(playerid, Textdraw44);
TextDrawShowForPlayer(playerid, Textdraw45);
TextDrawShowForPlayer(playerid, Textdraw49[playerid]);
TextDrawShowForPlayer(playerid, Textdraw51[playerid]);
TextDrawShowForPlayer(playerid, Textdraw55);
if(PlayerInfo[playerid][pWatch] == 1)
{
TextDrawShowForPlayer(playerid, Textdraw56);
TextDrawShowForPlayer(playerid, Textdraw57);
TextDrawShowForPlayer(playerid, Textdraw58);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "* Access Denied.");
}
}
return 1;
}
if (strcmp(cmd, "/update", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 4)
{
ShowPlayerDialog(playerid,19990,DIALOG_STYLE_LIST,"Select which thing do you want to reload","1\tUser file\n2\tVehicle File\n3\tHouse File\n3\tBizz File\n4\tSBizz File","Select","Cancel");
}
else
{
SendClientMessage(playerid, COLOR_GREY,"* You're not authorised to use this command!");
return 1;
}
return 1;
}