Really important!!
#1

So i made a system where a player can drop my gun and then it creates it a bit forward from the player and he can pick it up too but he can only pick it up from where he dropped it i want him to go towards the gun and in that position he can pick it up but he can only pick it up when he is at the position where he created the gun

So if i created the object (gun) like this
pawn Код:
CreateObject(GunObjects[GunID], dGunData[f][ObjPos][0], dGunData[f][ObjPos][1] - 0.5 * floatcos(-(ang + 90.0), degrees), dGunData[f][ObjPos][2]-1, 93.7, 120.0, ang + 60.0);
what do i then write on IsPlayerInRangeOfPoint?
Reply
#2

pawn Код:
If(IsPlayerInRangeOfPoint(playerid, 1.0, dGunData[f][ObjPos][0], dGunData[f][ObjPos][1] - 0.5 * floatcos(-(ang + 90.0), degrees), dGunData[f][ObjPos][2]-1))
I wouldn't personally have used 3-dimensional arrays for that but it's up to you man. :P
Reply
#3

Didnt work :/
Reply
#4

Errors that you received? And show me the code as well of where you placed it.
Reply
#5

No errors it just didnt work..
Reply
#6

Weird
Reply
#7

pawn Код:
for(new a = 0; a < MAX_OBJ; a++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 1.0, dGunData[a][ObjPos][0], dGunData[a][ObjPos][1] - 0.5 * floatcos(-(ang + 90.0), degrees), dGunData[a][ObjPos][2]-1))
            {
                f = a;
                break;
            }
        }
        if(f > MAX_OBJ) return SendClientMessage(playerid, CEL, "No weapon near you");
code
Reply
#8

bumpp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)