13.10.2012, 13:35
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(P_DATA[ playerid ][ P_InDM ] == 0 )return SendError( playerid, "[ERROR]: Cant use any commands while dming ..!!"); if(P_DATA[ playerid ][ P_Away ] == 0 )return SendError( playerid, "[ERROR]: use /back"); return 1; } CMD:afk( playerid, params[] ) { if((P_DATA[ playerid ][ P_Away ] = !P_DATA[ playerid ][ P_Away ])) SendClientMessage(playerid, COLOR_YELLOW, "You are now AFK, type /back to move again!"); TogglePlayerControllable(playerid,0); label[playerid] = Create3DTextLabel("AFK",yellow,30.0,40.0,50.0,40.0,0); Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7); new string3[164]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string3, sizeof(string3), "{FF0000}[AFK INFO]: {FFFFFF}%s is now Away from the keyboard.{FF0000}(/afk)", name); SendClientMessageToAll(COLOR_YELLOW, string3); return 1; }