Problems with /give cmd - 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: Problems with /give cmd (
/showthread.php?tid=264954)
Problems with /give cmd -
BizzyD - 28.06.2011
Hello, I got a problem with my /give cmd, When i am close to the player, It says: You are not near this player, But i am close.
This is the beggining of the code:
pawn Код:
CMD:give(playerid, params[])
{
new targetid, option[128], string[128];
if(sscanf(params, "us[128]", targetid, option))
{
SendClientMessage(playerid, RED, "[LOST:RP] /give [ID] [OPTION");
SendClientMessage(playerid, COLOR_WHITE, "[LOST:RP] Options: Matches,Firewood,WaterBottle,FishingRod,FishingNet,Heroin,Fish,WalkieTalkie");
return 1;
}
new targetname[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME];
GetPlayerName(targetid, targetname, sizeof(targetname));
GetPlayerName(playerid, sendername, sizeof(sendername));
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
new Float:tx,Float:ty,Float:tz;
GetPlayerPos(targetid,tx,ty,tz);
if(!IsPlayerInRangeOfPoint(playerid, 2.0, tx,ty,tz)) // Here
return SendClientMessage(playerid, RED, "[LOST:RP] You arent close to that player");
{
I dont understand it, It should be like that. But i can be standing next to the person, And it still says like that.
Anyone know how to solve?
Re: Problems with /give cmd -
sleepysnowflake - 28.06.2011
Make the 2.0 bigger. Like 6.0. The zone around the target position.
Re: Problems with /give cmd -
Shadoww5 - 28.06.2011
Is it the single line with
IsPlayerInRangeOfPoint ?