24.09.2010, 15:37
hi gays I have cmd to be afk
I want it to be like this
pawn Код:
if (strcmp("/afk", cmdtext, true) == 0)
{
if(IsPlayerVipMember(playerid))
{
TogglePlayerControllable(playerid, 0);
SetPlayerPos(playerid, 293, 2414, 17);
SendClientMessage(playerid, COLOR_Red, "to back type /back");
AFKCount++;
s = SetTimer("stop", 1000, true);
}
else
{
TogglePlayerControllable(playerid, 0);
SetPlayerPos(playerid, 293, 2414, 17);
SendClientMessage(playerid, COLOR_Red, "you will kick after 10 min if you didn't type /back");
AFKCount++;
s = SetTimer("stop", 1000, true);
k = SetTimer("kick", 600000, true);
}
return 1;
}
if (strcmp("/back", cmdtext, true) == 0)
{
if(IsPlayerVipMember(playerid))
{
TogglePlayerControllable(playerid, 1);
SetPlayerPos(playerid, 334, 2417, 17);
KillTimer(s);
AFKCount--;
}
else
{
KillTimer(s);
TogglePlayerControllable(playerid, 1);
SetPlayerPos(playerid, 334, 2417, 17);
KillTimer(k);
AFKCount--;
}
return 1;
}
pawn Код:
if (strcmp("/afk", cmdtext, true) == 0)
{
if(AccInfo[playerid][AFK] == 0)
(
if(IsPlayerVipMember(playerid))
{
AccInfo[playerid][AFK] = 1;
TogglePlayerControllable(playerid, 0);
SetPlayerPos(playerid, 293, 2414, 17);
SendClientMessage(playerid, COLOR_Red, "to back type /back");
AFKCount++;
s = SetTimer("stop", 1000, true);
}
else
{
AccInfo[playerid][AFK] = 1;
TogglePlayerControllable(playerid, 0);
SetPlayerPos(playerid, 293, 2414, 17);
SendClientMessage(playerid, COLOR_Red, "you will kick after 10 min if you didn't type /back");
AFKCount++;
s = SetTimer("stop", 1000, true);
k = SetTimer("kick", 600000, true);
}
}
else SendClientMessage(playerid. COLOR_Red, "you are alredy AFK");
return 1;
}
if (strcmp("/back", cmdtext, true) == 0)
{
if(AccInfo[playerid][AFK] == 1)
(
if(IsPlayerVipMember(playerid))
{
AccInfo[playerid][AFK] = 0;
TogglePlayerControllable(playerid, 1);
SetPlayerPos(playerid, 334, 2417, 17);
KillTimer(s);
AFKCount--;
}
else
{
AccInfo[playerid][AFK] = 0;
KillTimer(s);
TogglePlayerControllable(playerid, 1);
SetPlayerPos(playerid, 334, 2417, 17);
KillTimer(k);
AFKCount--;
}
}
else SendClientMessage(playerid. COLOR_Red, "you are not AFK");
return 1;
}