09.01.2014, 03:25
For my freeroam server, I figured i'd add a small map editor. When you do /search wall for example, it should load all objects with the word "wall" in them. Instead, it loads skins. What am I missing?
And the array is from some pastebin I found via ******.
For anyone else looking to do something similar, Here is the pastebin link. http://pastebin.com/LM2xuuJT
pawn Код:
CMD:search(playerid, params[])
{
new search[50], string1[60], string2[900];
if(sscanf(params, "s[50]", search)) return UsageMessage(pid, "/search [query]");
for(new i; i<MAX_OBJECTS; i++)
{
if(strfind(allObjects[i][arname], search))
{
format(string1, sizeof(string1), "%d\n", allObjects[i][arid]);
}
}
format(string2, sizeof(string2), "%s, {%s}", string2, string1);
ShowModelSelectionMenuEx(playerid, string2, 105, "Search Results", Search);
return 1;
}
pawn Код:
enum ARRAY_FORMAT_ALL_OBJECTS
{
arid,
arname[24],
arids[12],
arcategory[34],
arcategory_id
}
//Beach and Sea
new allObjects[][ARRAY_FORMAT_ALL_OBJECTS] = {
{ 902, "Starfish", "[902]", "General Beach and Sea", 0 },
{ 903, "seaweed", "[903]", "General Beach and Sea", 0 },...