How to make multiple cmds?
#1

how can i make more cmds? and how can i make cmds like /admins and show me the admins?Pls Pls Pls help
Reply
#2

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.
Reply
#3

thx alot
can you send me another link with dcmd cuz when i click on it gives error
Reply
#4

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.

Reply
#5

i am new in making scripts sooo
Reply
#6

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.
Reply
#7

https://sampwiki.blast.hk/wiki/Dcmd for dcmd. your welcome.
Reply
#8

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?
Reply
#9

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"
Reply
#10

i put at /(mycommand) "2" too?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)