SA-MP Forums Archive
Command help - 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: Command help (/showthread.php?tid=212704)



Command help - bartje01 - 17.01.2011

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.


Re: Command help - blackwave - 17.01.2011

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



Re: Command help - Mike_Peterson - 17.01.2011

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??



Re: Command help - legodude - 17.01.2011

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


Re: Command help - Mike_Peterson - 17.01.2011

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.


Re: Command help - bartje01 - 17.01.2011

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