[FilterScript] Ingame Object Searching (Textdraws)
#1

For all those who asked, here it is. This allows you to /search [query] ingame and it'll return objects which you can spawn. It's basically an ingame search engine like gta-sa-mp.de and/or MTA.

Include libraries you'll need:
- mSelection (By d0): thread
- oarray (By Pottus): pastebin
- zcmd (By Zeex): thread

Note (installation/proper mSelection config):
In order for the mSelection menu to show pages, you need to change the "mS_CUSTOM_MAX_ITEMS" value to MAX_OBJECTS. Not doing this will return constant console warnings about an invalid array size (seeing our object list exceeds the default one) and will only show you one page with 19 objects.

Credits: Pottus, TakeiT, Memoryz

Ingame picture:


pawn Код:
#include <a_samp>
#include <mSelection>
#include <oarray>
#include <zcmd>

#define SEARCH_MENU 1

CMD:search(playerid, params[])
{
    new items, arrSearch[125];

    if (isnull(params)) return SendClientMessage(playerid, -1, "/search [params]");

    for(new i; i < sizeof(ObjectList) && items < sizeof(arrSearch); i ++)
    {
        if(strfind(ObjectList[i][oName], params, true) != -1)
        {
            arrSearch[items ++] = ObjectList[i][oID];
        }
    }
   
    ShowModelSelectionMenuEx(playerid, arrSearch, items, "Search Results", SEARCH_MENU, 0.0, 0.0, 90.0);

    return true;
}

public OnPlayerModelSelectionEx(playerid, response, extraid, modelid)
{
    if(extraid == SEARCH_MENU)
    {
        if(response)
        {
            new Float:X, Float:Y, Float:Z, sel;
            GetPlayerPos(playerid, X, Y, Z);
           
            sel = CreateObject(modelid, X +1, Y, Z, 0.00, 0.00, 0.00);
            EditObject(playerid, sel);

            return true;
        }
    }
   
    return true;
}
Reply
#2

That's pretty fucking cool, I'll admit.
Reply
#3

Awesome stuff!
Reply
#4

This was made for a map editor, but'll work good for a quick events thing for a roleplay server.
Reply
#5

This is awesome!
Great work!
Reply
#6

Nice work
Reply
#7

That's cool! Great job!
Reply
#8

undefined symbol "ShowModelSelectionMenuEx"
and i got the inc
Reply
#9

Quote:
Originally Posted by AroseKhanNaizi
Посмотреть сообщение
undefined symbol "ShowModelSelectionMenuEx"
and i got the inc
If you have the include, it should work. Are you sure you have the latest version? (https://sampforum.blast.hk/showthread.php?tid=520621)
Reply
#10

Cool!
Reply
#11

Код:
#include <oarray>
What is this? O_O where i download it?

Sorry For Double Post.
Reply
#12

Quote:
Originally Posted by PowerF
Посмотреть сообщение
Код:
#include <oarray>
What is this? O_O where i download it?

Sorry For Double Post.
he provided paste bin link use it copy and make an file

sorry solved
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)