PDA

View Full Version : [HELP] extortion


Luca12
04/06/2014, 10:33 AM
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:

if(!strcmp(BussinesInfo[i][Extortion],name,true)) return SCM(playerid,COLOR_GRAD2,"You are not extortion in this bussines!");

MattTucker
04/06/2014, 11:17 AM
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..?

Luca12
04/06/2014, 11:43 AM
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

MattTucker
04/06/2014, 01:28 PM
Can you post your enum for 'BussinessInfo'?
like
enum binfo
{
//bla bla bla bla
}
new BusinessInfo[MAX_BIZ][binfo];


EDIT:
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
if(BussinesInfo[i][Extortion] == 1)
{
//your code
}
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:http://wiki.sa-mp.com/wiki/IsPlayerInRangeOfPoint

So it *might* be something like this
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
}