/Rob command... Help!
#1

Hi... I like to create a rob command! Like /Rob

I think this is how I shall do the code:

Код:
  if(strcmp(cmdtext, "/Rob", true) == 0)
  {
       GivePlayerMoney(playerid,1000);
       SetPlayerWantedLevel(playerid,6);
       SetPlayerColor(playerid,AZUL);
       SendClientMessage(playerid, ROJO, "You did a rob!");
       return 1;
  {
But I want it to do so they only can rob in shops, Like: Gunshop, Pizzashop, and many more.

How to do that?
Reply
#2

Cool.. joinning to the request..
Reply
#3

Get the player's interior when you enter the command, and if it's a gunshop, pizzashop or burgershot interior run the rest of the command, then for an else (for the interior thing). Just put 'You must be in a shop to commit a robbery!'
Reply
#4

Shall the code then be?

Код:
  if(strcmp(cmdtext, "/Rob", true) == 0)
  {
       GivePlayerMoney(playerid,1000);
       SetPlayerWantedLevel(playerid,6);
       SetPlayerColor(playerid,AZUL);
       SendClientMessage(playerid, ROJO, "You did a rob!");

  else SendClientMessage(playerid,GRIS,"'You must be in a shop to commit a robbery!");
  return 1;
  }
Reply
#5

lol

Код:
if(strcmp(cmdtext, "/Rob", true) == 0)
{
if(GetPlayerInterior(playerid) == INTERIORID) 
{
GivePlayerMoney(playerid,1000);
SetPlayerWantedLevel(playerid,6);
SetPlayerColor(playerid,AZUL);
SendClientMessage(playerid, ROJO, "You did a rob!");
return 1;
} else {
SendClientMessage(playerid,GRIS,"'You must be in a shop to commit a robbery!");
return 1;
}
return 1;
}
and if(GetPlayerArea(playerid.....))
or something like that could be good because it give more shops who have the same interiorid
Reply
#6

Код:
if(strcmp(cmdtext, "/rob", true) == 0)
{
  new PlayerInterior;
	PlayerInterior = GetPlayerInterior(playerid);
	if(PlayerInterior(playerid) == 1 || PlayerInterior(playerid) == 4 || PlayerInterior(playerid) == 6 || PlayerInterior(playerid) == 7 || PlayerInterior(playerid) == 17 || PlayerInterior(playerid) == 10 || PlayerInterior(playerid) == 18 || PlayerInterior(playerid) == 16 || PlayerInterior(playerid) == 4 || PlayerInterior(playerid) == 6)
	{
		GivePlayerMoney(playerid,1000);
		SetPlayerWantedLevel(playerid,6);
		SetPlayerColor(playerid,AZUL);
		SendClientMessage(playerid, ROJO, "You did a rob!");
		return 1;
	}
	else
	{
		SendClientMessage(playerid,GRIS,"'You must be in a shop to commit a robbery!");
		return 1;
	}
	return 1;
}
Something like that....
Reply
#7

why dont you use

Код:
PlayerToPoint
Reply
#8

Quote:
Originally Posted by [GM
The_Don ]
why dont you use

Код:
PlayerToPoint
Ah thats good too, is PlayerToPoint the same how isPlayerNearPos(playerid,X,Y,Z,Radius) ?
Reply
#9

yeah thats just what playertopoint is, just called something different by the looks of it
Reply
#10

"SendClientMessage(playerid, ROJO, "You did a rob!");"


SendClientMessage(playerid, ROJO, "You robbed someone or somthing.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)