SetTimer
#1

Code:
if(strcmp(cmd, "/news", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
			{
			    new newcar = GetPlayerVehicleID(playerid);
		        if(PlayerInfo[playerid][pMuted] == 1)
				{
					format(string, sizeof(string), "You can not speak, you have been silenced for %d seconds.",PlayerInfo[playerid][pMuteTime]);
				SendClientMessage(playerid, COLOR_LIGHTRED, string);
					return 1;
				}
				if(newcar == 140 || newcar == NR1 || newcar == NR2)
				{
					GetPlayerName(playerid, sendername, sizeof(sendername));
					new length = strlen(cmdtext);
					while ((idx < length) && (cmdtext[idx] <= ' '))
					{
						idx++;
					}
					new offset = idx;
					new result[64];
					while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
					{
						result[idx - offset] = cmdtext[idx];
						idx++;
					}
					result[idx - offset] = EOS;
					if(!strlen(result))
					{
						SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /news [newstext]");
						return 1;
					}
					if(PlayerInfo[playerid][pAdmin] == 0 || PlayerInfo[playerid][pHelper] == 0)
			    {
				    for(new i=0; i<MAX_ENTRY; i++)
					{
				 	    if(!Swear[i][0]) continue;
						Cenzura(result,Swear[i]);
					}
				}
					if(FindIP(result)) /// Anti-Reclama
		   			{
						SendClientMessage(playerid, COLOR_RED, "You have kicked for Guardian , because you wrote an IP Adress.");
						new advertiser[MAX_PLAYER_NAME];
						GetPlayerName(playerid, advertiser, sizeof(advertiser));
						format(string, sizeof(string), "GL BOT: {FFFF00}%s a primit Kick cu motivul: A scris un IP (Reclama)",advertiser);
						SendClientMessageToAll(COLOR_RED,string);
						KickLog(string);
						Kick(playerid);
						return 1;
					}
					if(anty(result) && PlayerInfo[playerid][pAdmin] == 0 && PlayerInfo[playerid][pHelper] == 0)
					{
		            new advertiser[MAX_PLAYER_NAME];
					GetPlayerName(playerid, advertiser, sizeof(advertiser));
					format(string, sizeof(string), "GL BOT: {FFFF00}%s a primit Kick cu motivul: Reclama pe /news",advertiser);
					SendClientMessageToAll(COLOR_RED,string);
					Kick(playerid);
					return 0;
					}
					format(string, sizeof(string), "NR %s: %s", sendername, result);
					OOCNews(COLOR_NEWS,string);
					PlayerInfo[playerid][pNewsSkill] ++;
					if(PlayerInfo[playerid][pNewsSkill] == 50)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 2, soon you are able to Fly the News Chopper and talk Live."); }
					else if(PlayerInfo[playerid][pNewsSkill] == 100)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 3, soon you are able to Fly the News Chopper and talk Live."); }
					else if(PlayerInfo[playerid][pNewsSkill] == 200)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 4, you can fly the News Chopper now."); }
					else if(PlayerInfo[playerid][pNewsSkill] == 400)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 5, you can now talk Live with any person you want."); }
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "   You are not in the News Van or Chopper !");
				    return 1;
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   You are not a News Reporter !");
			}
		}//not connected
		return 1;
	}
Vreau si eu sa adaug un timer la aceasta comanda si nu stiu cum. Vreau sa fie de 1 minute. Multumesc.
Reply
#2

Nu-mi amintesc cum era pt comanda, dar poti face o functie din comanda apoi folosesti SetTimer si CallLocalFunction.
Reply
#3

.........
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)