[HELP] extortion - 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)
+--- Thread: [HELP] extortion (
/showthread.php?tid=517300)
[HELP] extortion -
Luca12 - 04.06.2014
Hello I was make command /extortionwithdraw so that command do if player have extortion of some bussines he can get money from the bussines and I give extortion to the player and when is type that command it says you have no extortion of this bussines if you know what I mean. Here is that code:
pawn Код:
if(!strcmp(BussinesInfo[i][Extortion],name,true)) return SCM(playerid,COLOR_GRAD2,"You are not extortion in this bussines!");
Re: [HELP] extortion -
MattTucker - 04.06.2014
I don't really get what you're doing there but as far as I know strcmp compares strings, then BussinesInfo[i][Extortion] should be a string..?
Re: [HELP] extortion -
Luca12 - 04.06.2014
I want make a check if player is have extortion of the bussines near he stand then he get use extortionwithdraw if player has not extortion of that bussines he get return you are not extortion of this bussines
Re: [HELP] extortion -
MattTucker - 04.06.2014
Can you post your enum for 'BussinessInfo'?
like
pawn Код:
enum binfo
{
//bla bla bla bla
}
new BusinessInfo[MAX_BIZ][binfo];
EDIT:
Quote:
Originally Posted by Luca12
I want make a check if player is have extortion of the bussines
|
Maybe you have it as an integer value not a string? So you would use
pawn Код:
if(BussinesInfo[i][Extortion] == 1)
{
//your code
}
Quote:
Originally Posted by Luca12
near he stand then he get use extortionwithdraw if player has not extortion of that bussines he get return you are not extortion of this bussines
|
To get his position and compare it with the business's position (as far as I got it actually) you use IsPlayerInRangeOfPoint (Wiki:
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
So it *might* be something like this
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,3.0 /*float = 3.0*/ , /* Your X position that you want to compare */ , /*Your Y position that you want to compare */ , /* Your Z position that you want to compare */ );
{
// code
}