How to make multiple cmds? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make multiple cmds? (
/showthread.php?tid=77570)
How to make multiple cmds? -
Flavius - 12.05.2009
how can i make more cmds? and how can i make cmds like /admins and show me the admins?Pls Pls Pls help
Re: How to make multiple cmds? -
AiVAMAN - 12.05.2009
The easiest way to make commands is DCMD (
http://www.wiki.sa-mp.com/wiki/dcmd )
For /admins command you should use an admin filterscript like LAdmin (
http://forum.sa-mp.com/index.php?topic=36990.0 ) good luck with this.
Re: How to make multiple cmds? -
Flavius - 12.05.2009
thx alot
can you send me another link with dcmd cuz when i click on it gives error
Re: How to make multiple cmds? -
Weirdosport - 12.05.2009
If you want to make your own admin script and have all of the admins displayed as /admins there are 2 options.
You can either have them like:
Bob (lvl1)
Fred (lvl2)
or
Bob(lvl1), Fred(lvl2)
To do the first one you just need a for loop checking if each player is an admin, and if they are do a SendClientMessage. The second requires you to use something like strcat, or format if you're not comfortable with strcat.
Re: How to make multiple cmds? -
Flavius - 12.05.2009
i am new in making scripts sooo
Re: How to make multiple cmds? -
Weirdosport - 12.05.2009
In that case stick to a pre-made admin script, like xadmin, gadmin, ladmin ... generally any letter with "admin" on the end.. They're easy to find in the "Filterscripts and Includes" thread.
Re: How to make multiple cmds? -
AiVAMAN - 12.05.2009
https://sampwiki.blast.hk/wiki/Dcmd for dcmd.

your welcome.
Re: How to make multiple cmds? -
Flavius - 12.05.2009
yea i mean if i have
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
how can i put a second command?
Re: How to make multiple cmds? -
Weirdosport - 12.05.2009
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
if (strcmp("/mycommand2", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
I put the enters there just to separate each "block"
Re: How to make multiple cmds? -
Flavius - 12.05.2009
i put at /(mycommand) "2" too?