Error help.
#1

Well I was moving a pickup from a place to another,look:

Codes :
pawn Код:
"Line 10921"  if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
     "line 10922"   if(!IsPlayerInRangeOfPoint(playerid, 2.98,-7.17,-0.22,0.00,0.00,0.00)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the vehicles dealership.");



Error :
pawn Код:
C:\Users\Home\Desktop\NGZ\include\RLG.pwn(10922) : warning 202: number of arguments does not match definition
C:\Users\Home\Desktop\NGZ\include\RLG.pwn(10922) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
Reply
#2

The right usage of IsPlayerInRangeOfPoint:
pawn Код:
IsPlayerInRageOfPoint(playerid, Float:range, Float:x, Float:y, Float:z);
You only need the range of the point, then x , y , z.
But I think the numbers you put after "2.98" aren't the right coordinates (x,y,z)

To get the coordinates:
Get in game at the place you want then type /save , then go to Documents > GTA > SAMP > savedpositions.txt.
You will find something like:
Код:
AddPlayerClass(0,-481.3712,-220.6299,974.7113,6.0043,0,0,0,0,0,0);
"0" is the player skin.
"-481.3712" is X.
"-220.6299" is Y.
"6.0043" is Z.
So, you need to copy the first three numbers after the "0".
I hope that I helped you.
Reply
#3

IsPlayerRangeOfPoint(playerid, Float:range, Float, Float:y, Float:z)

try this

pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 2.98,-7.17,-0.22,0.00)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the vehicles dealership.");
Reply
#4

Ah... I took them from map editor :V
Reply
#5

Please check IsPlayerInRangeOfPoint function
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Parameters:
(playerid, Float:range, Float, Float:y, Float:z)
This function have 5 parameter but you used 7

Edit:
Wow i was writing post but guys above me posted faster
Sorry all
I didn't see your post
Reply
#6

It's not a problem if you took them from the map editor, you still can get the coordinates.
But, the coordinates you got aren't the right coordinates.
So, if you created an object, the code will be like:
pawn Код:
CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);
"2587" is the object ID.
"2001.195679" is X.
"1547.113892" is Y.
"14.283400" is Z.
Copy the first three numbers after the object ID, and it should work.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)