help me make a new command?
#2

okies i came up with this;....
Код:
if(!strcmp(cmdtext, "/robpizza", true))
	{
		if(!globC0B8[playerid])
		{
			SendClientMessage(playerid, 0xD2691EAA, "You are dead. You cannot use this command");
			return 1;
		}
		if(globB118[playerid] == 1)
		{
			SendClientMessage(playerid, 0xD2691EAA, "You are dead. You cannot use this command");
			return 1;
		}
		if(globCD38[playerid] == 1)
		{
			SendClientMessage(playerid, 0xD2691EAA, "You cannot use this command while you are handcuffed");
			return 1;
		}
		if(!IsPlayerInCheckpoint(playerid))
		{
			SendClientMessage(playerid, 0xD2691EAA, "You are not in the Pizza Shop robbing checkpoint");
			return 1;
		}
		if(IsPlayerInCheckpoint(playerid) && 89 != getCheckpointType(playerid))
		{
			SendClientMessage(playerid, 0xD2691EAA, "You are not in the Pizza Shop robbing checkpoint");
			return 1;
		}
		if(globA178[playerid] == 1 || globA178[playerid] == 2 || globA178[playerid] == 3 || globA178[playerid] == 5 || globA178[playerid] == 8)
		{
			SendClientMessage(playerid, 0xD2691EAA, "You cannot rob Pizza Shop");
			return 1;
		}
		if(IsPlayerInCheckpoint(playerid) && getCheckpointType(playerid) == 89)
		{
			if(glob24DD8 >= 1)
			{
				SendClientMessage(playerid, 0xD2691EAA, "Pizza Shop has been robbed recently. Try again later");
				return 1;
			}
			new var5 = random(100);
			if(var5 >= 0 && var5 <= 10)
			{
				SendClientMessage(playerid, 0xA9A9A9AA, "|_Pizza Shop Robbery Failed_|");
				SendClientMessage(playerid, 0xD2691EAA, "Your attempt to rob Pizza has failed");
				return 1;
			}
			if(var5 >= 11 && var5 <= 100)
			{
				new var6[30];
				new var7 = GetPlayerColor(playerid);
				GetPlayerName(playerid, var6, 30);
				new var8 = GetPlayerWantedLevel(playerid);
				SetPlayerWantedLevel(playerid, var8 + 4);
				glob22B38[playerid] = 15;
				SendClientMessage(playerid, 0x00C7FFAA, "You are now robbing Pizza Shop. The Police have been dispatched and will be on route right now");
				SendClientMessage(playerid, 0x00C7FFAA, "Stay in the checkpoint to complete the robbery...");
				var8 = GetPlayerWantedLevel(playerid);
				glob24DD8 = 240;
				SendClientMessage(playerid, 0xA9A9A9AA, "|_Crime Commited_|");
				format(var0, 256, "(Pizza Shop ROBBERY) Wanted Level %d", var8);
				SendClientMessage(playerid, var7, var0);
				glob16658[playerid] = glob16658[playerid] + 120;
				printf("%s(%d) has started a Pizza Shop robbery", var6, playerid);
				for(new var9 = 0; var9 < 200; var9++)
				{
					if(globBA78[var9] == 1)
					{
						new var10[256];
						new var11[256];
						format(var10, 256, "DISPATCH: (ROBBERY IN PROGRESS) Suspect: %s(%d)", var6, playerid);
						format(var11, 256, "ALL UNITS: Please respond to Pizza Shop and arrest %s(%d)", var6, playerid);
						SendClientMessage(var9, 0x4169FFAA, var10);
						SendClientMessage(var9, 0x4169FFAA, var11);
					}
				}
			}
		}
		return 1;
	}
Reply


Messages In This Thread
help me with my command? - by Abraham2nd - 04.11.2010, 19:53
Re: help me with my command? - by Abraham2nd - 04.11.2010, 20:07
Re: help me with my command? - by LarzI - 04.11.2010, 20:15
Re: help me make a new command? - by Abraham2nd - 04.11.2010, 20:17
Re: help me make a new command? - by WillyP - 04.11.2010, 20:19
Re: help me make a new command? - by The_Moddler - 04.11.2010, 20:29
Re: help me make a new command? - by Abraham2nd - 04.11.2010, 21:23
Re: help me make a new command? - by LarzI - 04.11.2010, 21:53
Re: help me make a new command? - by Abraham2nd - 05.11.2010, 08:40
Re: help me make a new command? - by audifan00 - 05.11.2010, 10:05

Forum Jump:


Users browsing this thread: 1 Guest(s)