Float question
#1

Hello,

I created a Float named "Trashcan" with multiples X Y Z A coords.

Like this

pawn Код:
new Float:Trashcan[][] =
{
    {-44.3092, 1178.2397, 19.4132, 3.6440},
    {-219.0647, 1164.8140, 19.7422, 272.4051},
    {-148.8153, 1133.7948, 19.7422, 90.2413},
    {-170.1543, 1170.0885, 19.7500, 182.2840},
    {-156.7292,1234.4429,19.7422,267.9447},
    {-89.5546,1128.2325,19.7422,93.8001},
    {-25.8537,1165.4301,19.3604,266.2787},
    {-44.2002,1178.2396,19.4132,3.2300},
    {-123.7713,897.6136,19.0959,91.1474},
    {-161.0603,1175.2235,19.7422,89.2595}
};
Now my question is, how to I identify these positions in the "IsPlayerInRangeOfPoint" because I want the player to be able to /search near all these positions.

Thanks.
Reply
#2

Don't just use this code, but it should be something like this.

PHP код:
CMD:search(playeridparams[])
{
    if (
IsPlayerInRangeOfPoint(playeridCOORD1COORD1COORD1COORD1)) 
    {
        
//code
    
}
    else if (
IsPlayerInRangeOfPoint(playeridCOORD2COORD2COORD2COORD2)) 
    {
        
//code
    
}
    else
    {
        
SendClientMessage(playerid0xFFFFFFFF"You aren't near a valid trash point!");
    }

UPDATE!
Maybe this thread can help you.
https://sampforum.blast.hk/showthread.php?tid=551113
Reply
#3

Maybe I missed something but I haven't found anything useful on the thread.

Yes I know for the code, but I want to replace the COORD1, COORD2 with any of the positions in my Float.
Reply
#4

Quote:
Originally Posted by Adamsy
Посмотреть сообщение
Maybe I missed something but I haven't found anything useful on the thread.

Yes I know for the code, but I want to replace the COORD1, COORD2 with any of the positions in my Float.
Instead of using IsPlayerInRangeOfPoint, use IsPlayerInDynamicArea. Line 209 of the filterscript I linked. It should lead you into that direction.
Reply
#5

I need a plugin for IsPlayerInDynamicArea + I barely understand his script, I'm sure there must be a more simple way.
Reply
#6

Quote:
Originally Posted by Adamsy
Посмотреть сообщение
I need a plugin for IsPlayerInDynamicArea + I barely understand his script, I'm sure there must be a more simple way.
Use streamer then.

https://sampforum.blast.hk/showthread.php?tid=102865
Reply
#7

You also have to create the areas.
Reply
#8

I already have the streamer. My areas are in the float above, can you tell me how to use DynamicAreas for my purpose please which is be able to /search at the multiples positions ?
Reply
#9

pawn Код:
native STREAMER_TAG_AREA CreateDynamicCircle(Float:x, Float:y, Float:size, worldid = -1, interiorid = -1, playerid = -1);
native STREAMER_TAG_AREA CreateDynamicCylinder(Float:x, Float:y, Float:minz, Float:maxz, Float:size, worldid = -1, interiorid = -1, playerid = -1);
native STREAMER_TAG_AREA CreateDynamicSphere(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1);
native STREAMER_TAG_AREA CreateDynamicRectangle(Float:minx, Float:miny, Float:maxx, Float:maxy, worldid = -1, interiorid = -1, playerid = -1);
native STREAMER_TAG_AREA CreateDynamicCuboid(Float:minx, Float:miny, Float:minz, Float:maxx, Float:maxy, Float:maxz, worldid = -1, interiorid = -1, playerid = -1);
native STREAMER_TAG_AREA CreateDynamicCube(Float:minx, Float:miny, Float:minz, Float:maxx, Float:maxy, Float:maxz, worldid = -1, interiorid = -1, playerid = -1);
native STREAMER_TAG_AREA CreateDynamicPolygon(Float:points[], Float:minz = -FLOAT_INFINITY, Float:maxz = FLOAT_INFINITY, maxpoints = sizeof points, worldid = -1, interiorid = -1, playerid = -1);
native DestroyDynamicArea(STREAMER_TAG_AREA areaid);
native IsValidDynamicArea(STREAMER_TAG_AREA areaid);
native GetDynamicPolygonPoints(STREAMER_TAG_AREA areaid, Float:points[], maxpoints = sizeof points);
native GetDynamicPolygonNumberPoints(STREAMER_TAG_AREA areaid);
native IsPlayerInDynamicArea(playerid, STREAMER_TAG_AREA areaid, recheck = 0);
native IsPlayerInAnyDynamicArea(playerid, recheck = 0);
native IsAnyPlayerInDynamicArea(STREAMER_TAG_AREA areaid, recheck = 0);
native IsAnyPlayerInAnyDynamicArea(recheck = 0);
native GetPlayerDynamicAreas(playerid, STREAMER_TAG_AREA areas[], maxareas = sizeof areas);
native GetPlayerNumberDynamicAreas(playerid);
native IsPointInDynamicArea(STREAMER_TAG_AREA areaid, Float:x, Float:y, Float:z);
native IsPointInAnyDynamicArea(Float:x, Float:y, Float:z);
native IsLineInDynamicArea(STREAMER_TAG_AREA areaid, Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2);
native IsLineInAnyDynamicArea(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2);
native GetDynamicAreasForPoint(Float:x, Float:y, Float:z, STREAMER_TAG_AREA areas[], maxareas = sizeof areas);
native GetNumberDynamicAreasForPoint(Float:x, Float:y, Float:z);
native GetDynamicAreasForLine(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, STREAMER_TAG_AREA areas[], maxareas = sizeof areas);
native GetNumberDynamicAreasForLine(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2);
native AttachDynamicAreaToObject(STREAMER_TAG_AREA areaid, STREAMER_TAG_OBJECT_ALT objectid, type = STREAMER_OBJECT_TYPE_DYNAMIC, playerid = INVALID_PLAYER_ID, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0);
native AttachDynamicAreaToPlayer(STREAMER_TAG_AREA areaid, playerid, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0);
native AttachDynamicAreaToVehicle(STREAMER_TAG_AREA areaid, vehicleid, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0);
http://forum.sa-mp.com/showpost.php?...1&postcount=12

I'm pretty sure you can figure out what to do next.
Reply
#10

Lol, this is Chinese to me... I don't know anything about native and stuff for the moment.

Couldn't it be more simple if I use IsPlayerInRangeOfPoint(playerid, FLOATabove, FLOATabove, FLOATabove);
why can't I use this instead ?
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)