Command help
#1

Hey guys. can I have some help please?

pawn Код:
COMMAND:fish(playerid,params[])
{
if(!IsPlayerInRangeOfPoint(playerid == 7,2941.1365,-2051.7290,3.5480,269.1705)) return SendClientMessage(playerid,COLOR_DARKORANGE,"You're not at the fishing place");
if(fishprogress[playerid] > 0) return SendClientMessage(playerid,COLOR_DARKORANGE,"You're already doing this job!");
else
fishprogress[playerid] = 1;
SendClientMessage(playerid,COLOR_DARKORANGE,"You've started your fishing job. Take a boat and go to the checkpoints!");
SetPlayerCheckpoint(playerid,3019.4819,-1259.1970,0.8884,315.4811);
return 1;
}
The problem is that even if I'm at the coordiantes it still says: You're not at the fishing place
I guess I'm failing somewhere again.
Reply
#2

Cuz ya put wrong the IsPlayerRangeOfPoint range's wrongly. Also SO close. Try this:
pawn Код:
COMMAND:fish(playerid,params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 15,2941.1365,-2051.7290,3.5480,269.1705)) return SendClientMessage(playerid,COLOR_DARKORANGE,"You're not at the fishing place");
if(fishprogress[playerid] > 0) return SendClientMessage(playerid,COLOR_DARKORANGE,"You're already doing this job!");
else
fishprogress[playerid] = 1;
SendClientMessage(playerid,COLOR_DARKORANGE,"You've started your fishing job. Take a boat and go to the checkpoints!");
SetPlayerCheckpoint(playerid,3019.4819,-1259.1970,0.8884,315.4811);
return 1;
}
Reply
#3

pawn Код:
if(!IsPlayerInRangeOfPoint(playerid == 7,2941.1365,-2051.7290,3.5480,269.1705)) return SendClientMessage(playerid,COLOR_DARKORANGE,"You're not at the fishing place");
That line is weird.
dont you got an extra parameter?
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid,7,2941.1365,-2051.7290,3.5480) return SendClientMessage(playerid,COLOR_DARKORANGE,"You're not at the fishing place"); // what is 269.1705??
Reply
#4

your isplayerinrangeofpoint isnt right

it must be

IsPlayerInRangeOfPoint(playerid,x,y,z,range) you have IsPlayerInRangeOfPoint(playerid == range,x,y,z,) wich i cant seem to understand that it compiles
Reply
#5

Quote:
Originally Posted by legodude
Посмотреть сообщение
your isplayerinrangeofpoint isnt right

it must be

IsPlayerInRangeOfPoint(playerid,x,y,z,range) you have IsPlayerInRangeOfPoint(playerid == range,x,y,z,) wich i cant seem to understand that it compiles
Did u look at the native? the == is wrong indeed. but the range is good though.
Reply
#6

Quote:
Originally Posted by legodude
Посмотреть сообщение
your isplayerinrangeofpoint isnt right

it must be

IsPlayerInRangeOfPoint(playerid,x,y,z,range) you have IsPlayerInRangeOfPoint(playerid == range,x,y,z,) wich i cant seem to understand that it compiles
I don't know what you're talking about. Lol, the range is alright.

I fixed it.
My coordinates weren't right.

Thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)