SA-MP Forums Archive
SetTimer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetTimer (/showthread.php?tid=512794)



SetTimer - DarkWolfff - 12.05.2014

Код:
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;
	}
I want to introduction a timer for 1 minute.