29.03.2014, 09:54
Hello there,
I've currently added the objects array list, and Im doing a special command for it, well here's the command:
The problem in this command is that some objects got large names, and other objects can have the same firstname etc.. so theres more than object has the same name (not really), but in formatting it doesnt continue the name, so I hope that someone understood.
Thanks in advance!
I've currently added the objects array list, and Im doing a special command for it, well here's the command:
pawn Код:
CMD:objectsnamelist(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pMapper] >= 1 || PlayerInfo[playerid][pMember] == 666)
{
SendClientMessage(playerid, COLOR_YELLOW,"~~~~~~~~~~~~~~~~~~~~");
SendClientMessage(playerid, COLOR_WHITE, "Objects Name Search:");
new
string[128];
if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "No keyword specified.");
if(!params[2]) return SendClientMessage(playerid, COLOR_GREY, "Search keyword too short.");
for(new e; e < sizeof(ObjectList); e++) {
if(strfindex(ObjectList[e], params, true) != -1) {
if(isnull(string)) format(string, sizeof(string), "%s (ID %d)", ObjectList[e][oName], ObjectList[e][oID]);
else format(string, sizeof(string), "%s | %s (ID %d)", string,ObjectList[e][oName], ObjectList[e][oID]);
}
}
if(!string[0]) SendClientMessage(playerid, COLOR_GREY, "No results found.");
else if(string[127]) SendClientMessage(playerid, COLOR_GREY, "Too many results found.");
else SendClientMessage(playerid, COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_YELLOW, "~~~~~~~~~~~~~~~~~~~~");
}
return 1;
}
Thanks in advance!