15.01.2011, 17:50
hy how i can make cmd /afk and /back how i can make when i write /afk my camerda has a slowli spin
bad english.. Sorry
bad english.. Sorry
Search returned this (took me 2 seconds) -> https://sampforum.blast.hk/showthread.php?tid=204575
|
new IsPlayerAFK[MAX_PLAYERS];
IsPlayerAFK[playerid] = 0;
new string[128], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(strcmp("/afk", cmdtext, true, 4) == 0)
{
if(!IsPlayerAFK[playerid])
{
format(string, sizeof(string), "** [ID: %d] %s is now AFK.",playerid,PlayerName);
SendClientMessageToAll(0xFFFFFFAA, string);
TogglePlayerControllable(playerid,0);
IsPlayerAFK[playerid] = 1;
}
else
{
format(string, sizeof(string), "** [ID: %d] %s is no longer AFK.",playerid,PlayerName);
SendClientMessageToAll(0xFFFFFFAA, string);
TogglePlayerControllable(playerid,1);
IsPlayerAFK[playerid] = 0;
}
return 1;
}