[HELP] extortion
#1

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!");
Reply
#2

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..?
Reply
#3

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
Reply
#4

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
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)