28.06.2011, 19:41
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:
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?
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");
{
Anyone know how to solve?