help me make a new command?
#1

can someone please help me?
i want to add these command:
/robpizza
/robburger
and the other food places
but have no luck
pls give me one?
Reply
#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
#3

Quote:
Originally Posted by Abraham2nd
Посмотреть сообщение
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;
	}
Looks like to me that you didn't come up with it, but DeAMX'd it.
Reply
#4

yea lol do you know if it will work?? btw i changed some in it so...
Reply
#5

LarzI, how did you know? All I thought was that the checkpoint ID's were
Reply
#6

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
LarzI, how did you know? All I thought was that the checkpoint ID's were
It's antiAMXded becouse of the string names..
Reply
#7

the glOBB? XD
Cant anyone help me!!11///
Reply
#8

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
LarzI, how did you know? All I thought was that the checkpoint ID's were
Quote:
Originally Posted by The_Moddler
Посмотреть сообщение
It's antiAMXded becouse of the string names..
True.

globC0B8

var1-12

seriously.. Who calls variables something like that in their script?
Reply
#9

is any1 out there capable of doing so
Reply
#10

can you be more specific please?

because you can use ifplayertopoint, setplayeranimation, freeze player for 2 seconds, unfreeze, sendclientmessagetoall..

like those functions?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)