/rob and can't get the id
#1

Hey all, i want ask something about this (i'm using Raven's Roleplay):

Код:
/* --------- /robdonut --------- */

	if(strcmp(cmd, "/robdonut", true) == 0)
	{
	    new success = random(3);
	    new alarm[128];
	    if(DonutRobbedRecently == 1)
		{
		    SendClientMessage(playerid, COLOR_GREY, "ERROR: Ups, this is not Your lucky day. This bank has been robbed recently!");
		    return 1;
		}
		if(PlayerInfo[playerid][pRobTime] >= 1)
		{
		    SendClientMessage(playerid, COLOR_GREY, "ERROR: You already rob, You are wanted right now!");
		    return 1;
		}
		if(IsPlayerInRangeOfPoint(playerid, 15, 378.0147,-186.2342,1000.6328))
	    {
	        if(GetPlayerWeapon(playerid) >= 24 && GetPlayerWeapon(playerid) <= 40)
			{
		        if(PlayerInfo[playerid][pDuty] == 0)
				{
			        if(success == 1)
					{
				        SendClientMessage(playerid, COLOR_ORANGE, "SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!");
				        SendClientMessage(playerid, COLOR_RED, "WARNING: Someone has been turned on the alarm!");
	                    RobbingTime[playerid] = 90;
						RobDonutTimer = SetTimerEx("RobDonut",1000,true,"i",playerid);
			            PlayerInfo[playerid][pRobTime] = 10800;
			            DonutRobbedRecently = 1;
						SetTimer("UnsetDonutRob",1500000,false);
						OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0);
						GameTextForPlayer(playerid, "~w~Donut Shop alarm ~r~ACTIVE~n~~w~Police will come to Donut Shop", 6000, 4);
						format(alarm, sizeof(alarm), "ATTENTION: Donut Shop alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!!!");
						SendRadioMessage(1, TEAM_CYAN_COLOR, alarm);
						SendRadioMessage(2, TEAM_CYAN_COLOR, alarm);
						SendRadioMessage(3, TEAM_CYAN_COLOR, alarm);
					}
					if(success == 2)
					{
				        SendClientMessage(playerid, COLOR_ORANGE, "SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!");
				        SendClientMessage(playerid, COLOR_RED, "WARNING: Someone has been turned on the alarm!");
						RobDonutTimer = SetTimerEx("RobDonut",1000,true,"i",playerid);
			            PlayerInfo[playerid][pRobTime] = 10800;
			            DonutRobbedRecently = 1;
						SetTimer("UnsetDonutRob",1500000,false);
						OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0);
						GameTextForPlayer(playerid, "~w~Donut Shop alarm ~r~ACTIVE~n~~w~Police will come to Donut Shop", 6000, 4);
						format(alarm, sizeof(alarm), "ATTENTION: Donut Shop alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!!!");
						SendRadioMessage(1, TEAM_CYAN_COLOR, alarm);
						SendRadioMessage(2, TEAM_CYAN_COLOR, alarm);
						SendRadioMessage(3, TEAM_CYAN_COLOR, alarm);
					}
					if(success == 3)
					{
				        SendClientMessage(playerid, COLOR_ORANGE, "SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!");
	                    RobbingTime[playerid] = 90;
						RobDonutTimer = SetTimerEx("RobDonut",1000,true,"i",playerid);
			            PlayerInfo[playerid][pRobTime] = 10800;
			            DonutRobbedRecently = 1;
						SetTimer("UnsetDonutRob",1500000,false);
						OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0);
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "* Go Off duty first!");
				    return 1;
				}
            }
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
			    return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_GREY, "* You're not at the Donut Store Rob Point!");
		    return 1;
		}
		return 1;
	}
That my /robdonut command and when i type that command and working with alarm so Police will get text like this "ATTENTION: Donut Shop alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!!!" but how to input an id of business at there?

So i mean that when someone rob the donut and alarm active so Police will get text like this "ATTENTION: Donut Shop alarm at %d.street active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!!!" (%d = businessid), can somebody help me with this
Reply
#2

When a player uses /enter, it would be logical the id of the business is stored in a variable..
try to get that variable, and input it, with formatting a string, into the text, after that send it to all cops online
Reply
#3

Hem i try something like this and i get this in /enter for business:

Код:
/* --------- /robdonut --------- */

	if(strcmp(cmd, "/robdonut", true) == 0)
	{
	    new success = random(3);
	    new alarm[128];
	    if(DonutRobbedRecently == 1)
		{
		    SendClientMessage(playerid, COLOR_GREY, "ERROR: Ups, this is not Your lucky day. This bank has been robbed recently!");
		    return 1;
		}
		if(PlayerInfo[playerid][pRobTime] >= 1)
		{
		    SendClientMessage(playerid, COLOR_GREY, "ERROR: You already rob, You are wanted right now!");
		    return 1;
		}
		for(new b = 0; b < sizeof(BizzInfo); b++)
		{
			if(IsPlayerInRangeOfPoint(playerid, 15, 378.0147,-186.2342,1000.6328))
		    {
		        if(GetPlayerWeapon(playerid) >= 24 && GetPlayerWeapon(playerid) <= 40)
				{
			        if(PlayerInfo[playerid][pDuty] == 0)
					{
				        if(success == 1)
						{
					        SendClientMessage(playerid, COLOR_ORANGE, "SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!");
					        SendClientMessage(playerid, COLOR_RED, "WARNING: Someone has been turned on the alarm!");
		                    RobbingTime[playerid] = 90;
							RobDonutTimer = SetTimerEx("RobDonut",1000,true,"i",playerid);
				            PlayerInfo[playerid][pRobTime] = 10800;
				            DonutRobbedRecently = 1;
							SetTimer("UnsetDonutRob",1500000,false);
							OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0);
							GameTextForPlayer(playerid, "~w~Donut Shop alarm ~r~ACTIVE~n~~w~Police will come to Donut Shop", 6000, 4);
							format(alarm, sizeof(alarm), "ATTENTION: Donut Shop at %d.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!!!",b);
							SendRadioMessage(1, TEAM_CYAN_COLOR, alarm);
							SendRadioMessage(2, TEAM_CYAN_COLOR, alarm);
							SendRadioMessage(3, TEAM_CYAN_COLOR, alarm);
						}
						if(success == 2)
						{
					        SendClientMessage(playerid, COLOR_ORANGE, "SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!");
					        SendClientMessage(playerid, COLOR_RED, "WARNING: Someone has been turned on the alarm!");
							RobDonutTimer = SetTimerEx("RobDonut",1000,true,"i",playerid);
				            PlayerInfo[playerid][pRobTime] = 10800;
				            DonutRobbedRecently = 1;
							SetTimer("UnsetDonutRob",1500000,false);
							OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0);
							GameTextForPlayer(playerid, "~w~Donut Shop alarm ~r~ACTIVE~n~~w~Police will come to Donut Shop", 6000, 4);
							format(alarm, sizeof(alarm), "ATTENTION: Donut Shop at %d.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!!!",b);
							SendRadioMessage(1, TEAM_CYAN_COLOR, alarm);
							SendRadioMessage(2, TEAM_CYAN_COLOR, alarm);
							SendRadioMessage(3, TEAM_CYAN_COLOR, alarm);
						}
						if(success == 3)
						{
					        SendClientMessage(playerid, COLOR_ORANGE, "SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!");
		                    RobbingTime[playerid] = 90;
							RobDonutTimer = SetTimerEx("RobDonut",1000,true,"i",playerid);
				            PlayerInfo[playerid][pRobTime] = 10800;
				            DonutRobbedRecently = 1;
							SetTimer("UnsetDonutRob",1500000,false);
							OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0);
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY, "* Go Off duty first!");
					    return 1;
					}
	            }
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
				    return 1;
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "* You're not at the Donut Store Rob Point!");
			    return 1;
			}
		}
		return 1;
	}
*The red line is new!

When i try to rob that spam me with different business id (i just have 30 business):
Код:
[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 0.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 1.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 2.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 3.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 4.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 5.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 6.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 7.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 8.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 9.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units!

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 10.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 11.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 12.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 13.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 14.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 15.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 16.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 17.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 18.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 19.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 20.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 21.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 22.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 23.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 24.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 25.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 26.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 27.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 28.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 29.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 30.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 31.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 32.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 33.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 34.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 35.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:24] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:24] WARNING: Someone has been turned on the alarm!

[20:02:24] ATTENTION: Donut Shop at 36.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:25] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:25] WARNING: Someone has been turned on the alarm!

[20:02:25] ATTENTION: Donut Shop at 37.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:25] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:25] WARNING: Someone has been turned on the alarm!

[20:02:25] ATTENTION: Donut Shop at 38.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:25] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:25] WARNING: Someone has been turned on the alarm!

[20:02:25] ATTENTION: Donut Shop at 39.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:25] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:25] WARNING: Someone has been turned on the alarm!

[20:02:25] ATTENTION: Donut Shop at 40.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:25] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:25] WARNING: Someone has been turned on the alarm!

[20:02:25] ATTENTION: Donut Shop at 41.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:25] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:25] WARNING: Someone has been turned on the alarm!

[20:02:25] ATTENTION: Donut Shop at 42.street alarm active so that must be someone try to rob Donut Shop, go to Donut Shop with more units

[20:02:25] SUCCESS: You are now robbing Donut Shop, stay in checkpoint for 90 seconds until you get the money!

[20:02:25] WARNING: Someone has been turned on the alarm!
I got that from chatlog and that make my money 2 hundrer million, so what wrong? I just want /robdonut and just show 1 id for the police...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)