SA-MP Forums Archive
Can you tell me what's worng? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Can you tell me what's worng? (/showthread.php?tid=256328)



Can you tell me what's worng? - Cjgogo - 20.05.2011

In another topic I said I was making a shop-robbery system but it wasn't working,however I got help and now it's fixed(Before fixing it I was able to type rob everywhere on the map and it gave me money) :

pawn Код:
COMMAND:rob(playerid,params[])
{
   if(gTeam[playerid] == TEAM_ROBBERS)
   {
      if(IsPlayerInRangeOfPoint(playerid,3.0,377.0883,-115.8647,1001.4922) || IsPlayerInRangeOfPoint(playerid,3.0,-2235.9595,128.4391,1035.4141) ||
      IsPlayerInRangeOfPoint(playerid,3.0,379.6420,-8.8524,1001.8516) || IsPlayerInRangeOfPoint(playerid,3.0,378.3380,-65.0391,1001.5078) ||
      IsPlayerInRangeOfPoint(playerid,3.0,161.4013,-79.2683,1001.8047) || IsPlayerInRangeOfPoint(playerid,3.0,-202.0584,-5.0931,1002.2734) ||
      IsPlayerInRangeOfPoint(playerid,3.0,418.5518,-75.7314,1001.8047) || IsPlayerInRangeOfPoint(playerid,3.0,502.6806,-11.5208,1000.6797) ||
      IsPlayerInRangeOfPoint(playerid,3.0,204.0275,-40.4131,1001.8047))
      {
         countn = 15;
         counttimer = SetTimer("CountDown",1000,true);
      }
      if(GetPlayerInterior(playerid) == -1) return SendClientMessage(playerid,COLOR_FORESTGREEN,"This command can be used only on a shop");
   }
  return true;
}
The only problem is that if I'm outside a shop the command isn't working(THIS IS GOOD NOT THIS IS THE PROBLEM),the only problem is it doesn't send the message:This cmmand must be used on a shop.So I guess I have to do it with IsPlayerInRangeOfPoint but how?


Re: Can you tell me what's worng? - Cjgogo - 20.05.2011

anyone?


Re: Can you tell me what's worng? - Sascha - 20.05.2011

pawn Код:
COMMAND:rob(playerid,params[])
{
   if(gTeam[playerid] == TEAM_ROBBERS)
   {
      if(IsPlayerInRangeOfPoint(playerid,3.0,377.0883,-115.8647,1001.4922) || IsPlayerInRangeOfPoint(playerid,3.0,-2235.9595,128.4391,1035.4141) ||
      IsPlayerInRangeOfPoint(playerid,3.0,379.6420,-8.8524,1001.8516) || IsPlayerInRangeOfPoint(playerid,3.0,378.3380,-65.0391,1001.5078) ||
      IsPlayerInRangeOfPoint(playerid,3.0,161.4013,-79.2683,1001.8047) || IsPlayerInRangeOfPoint(playerid,3.0,-202.0584,-5.0931,1002.2734) ||
      IsPlayerInRangeOfPoint(playerid,3.0,418.5518,-75.7314,1001.8047) || IsPlayerInRangeOfPoint(playerid,3.0,502.6806,-11.5208,1000.6797) ||
      IsPlayerInRangeOfPoint(playerid,3.0,204.0275,-40.4131,1001.8047))
      {
         countn = 15;
         counttimer = SetTimer("CountDown",1000,true);
      }
      else SendClientMessage(playerid, 0x999999AA, "This cmmand must be used on a shop.");
      if(GetPlayerInterior(playerid) == -1) return SendClientMessage(playerid,COLOR_FORESTGREEN,"This command can be used only on a shop");
   }
  return true;
}



Re: Can you tell me what's worng? - Vince - 20.05.2011

-1 is not a valid interior id. The default world is id 0.


Re: Can you tell me what's worng? - Cjgogo - 20.05.2011

thanks both but vince's psot helped