SA-MP Forums Archive
A way to show all CMD: lines - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: A way to show all CMD: lines (/showthread.php?tid=343490)



A way to show all CMD: lines - milanosie - 17.05.2012

Alright, I am trying to make /allcommands, but since I have over 45k lines in my gamemode already, adding all command manually will be a disaster.

Is there a way to find all lines that include CMD:blablabla or something?
And show those?

Milan


Re: A way to show all CMD: lines - FalconX - 17.05.2012

Quote:
Originally Posted by milanosie
Посмотреть сообщение
Alright, I am trying to make /allcommands, but since I have over 45k lines in my gamemode already, adding all command manually will be a disaster.

Is there a way to find all lines that include CMD:blablabla or something?
And show those?

Milan
CTRL + F and find your commands this way.

-FalconX


Re: A way to show all CMD: lines - milanosie - 17.05.2012

Quote:
Originally Posted by FalconX
Посмотреть сообщение
CTRL + F and find your commands this way.

-FalconX
I know,
but I mean in game.

Like a command that automaticly shows all lines with CMD:


Re: A way to show all CMD: lines - Mandrakke - 17.05.2012

ok, take all your code, put it in pastebin.com (do not forget to select "private" and "unlisted" in the pastebin options), then, in the your code's pastebin page, if you are using Firefox, type ctrl + shift + K and in the command line execute it;

Код:
r = document.getElementsByTagName("textarea")[0].innerHTML.match(/CMD\:.*?\(/gi);
o = "";
for(x in r)
     o += r[x].match(/CMD\:(.*?)\(/i)[1]+"\n";
alert(o);
- edit -
I've changed the code, it was capturing the commands twice.


Re: A way to show all CMD: lines - milanosie - 17.05.2012

thanks

Had to do it in 5 times to not exceed the limit:P


Re: A way to show all CMD: lines - miley1 - 17.05.2012

Milan I aint a pro But when i Wish To add someting into My script i just Search for a Created Command And paste it between It , My server got over 94k lines lol but u made yourself so u better haha :P


Re: A way to show all CMD: lines - milanosie - 17.05.2012

Quote:
Originally Posted by miley1
Посмотреть сообщение
Milan I aint a pro But when i Wish To add someting into My script i just Search for a Created Command And paste it between It , My server got over 94k lines lol but u made yourself so u better haha :P
Okay...

Your point is?


Re: A way to show all CMD: lines - Mandrakke - 17.05.2012

to avoid executing the code several times to not exceed alert text size, you can use that;

Код:
r = document.getElementsByTagName("textarea")[0].innerHTML.match(/CMD\:.*?\(/gi);
o = "";
for(x in r)
     o += r[x].match(/CMD\:(.*?)\(/i)[1]+"\n";
document.body.innerHTML = o+document.body.innerHTML;