Help with making a timer for /ame
#1

Hello, and first i'd like to thank everyone who contributes to this, well here is my problem. in-game i do /ame (blah blah) and it says and it wont go away, im not the best at scripting so this is kinda new to me, How instead of having to do /ame off to turn it off i would like it to go away in 7 seconds

here is the code for the command,

Код:
CMD:ame(playerid, params[])
{
    new activewep = GetPVarInt(playerid, "activesling");
	new message[100], string[128];
	if(sscanf(params, "s[100]", message))
	{
		SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /ame [action]");
		SendClientMessageEx(playerid, COLOR_GRAD2, "NOTE: Set the action to OFF to remove the label.");
		return 1;
	}
	if(activewep > 0)
	{
	    SendClientMessageEx(playerid, COLOR_GRAD2, "  You have a weapon slung around your back, you can't use /ame.");
	    return 1;
	}
	if(strcmp(message, "off", true) == 0)
	{
	    SendClientMessageEx(playerid, COLOR_GRAD2, "  You have removed the description label.");

	    DestroyDynamic3DTextLabel(PlayerInfo[playerid][aMeID]);
	    PlayerInfo[playerid][aMeStatus] =0;
	    return 1;
	}
	if(strlen(message) > 100) return SendClientMessageEx(playerid, COLOR_GRAD2, "  The action is too long, please reduce the length.");
	if(strlen(message) < 3) return SendClientMessageEx(playerid, COLOR_GRAD2, "  The action is too short, please increase the length.");
	if(PlayerInfo[playerid][aMeStatus] == 0)
	{
	    PlayerInfo[playerid][aMeStatus] =1;

		format(string, sizeof(string), "* %s %s", GetPlayerNameEx(playerid), message);
		PlayerInfo[playerid][aMeID] = CreateDynamic3DTextLabel(string, COLOR_PURPLE, 0.0, 0.0, 0.0, 20.0, playerid);
		ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		return 1;
	}
	else
	{
		format(string, sizeof(string), "* %s %s", GetPlayerNameEx(playerid), message);
		UpdateDynamic3DTextLabelText(PlayerInfo[playerid][aMeID], COLOR_PURPLE, string);
		ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		return 1;
	}
}
Reply


Messages In This Thread
Help with making a timer for /ame - by NickMirra - 21.05.2015, 19:46
Re: Help with making a timer for /ame - by Tessa - 21.05.2015, 20:11
Re: Help with making a timer for /ame - by NickMirra - 21.05.2015, 20:15
Re: Help with making a timer for /ame - by NickMirra - 21.05.2015, 20:36
Re: Help with making a timer for /ame - by Tessa - 21.05.2015, 21:09

Forum Jump:


Users browsing this thread: 1 Guest(s)