SA-MP Forums Archive
How to Make /rules cmd and other 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)
+--- Thread: How to Make /rules cmd and other Cmds (/showthread.php?tid=318750)



How to Make /rules cmd and other Cmds - [Cali]ChrOnic_T - 16.02.2012

Hello, Umm im wondering How to make /rules command. I know the Strmpcmd here is how i use it

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		 SendCilentMessage("1.No teamKilling
		return 1;
	}
	return 0;
But Can yall show me the right format its suppose to be?


Re: How to Make /rules cmd and other Cmds - BleverCastard - 16.02.2012

^ Dont use that use ZCMD:
Код:
CMD:rules(playerid, params[]) {
        SendClientMessage(playerid, COLOR, "TEXTT");
     return 1;
}



Re: How to Make /rules cmd and other Cmds - Littlehelper - 16.02.2012

Код:
if(strcmp("/rules",cmdtext,true, 10) == 0)
{
SendClientMessage(playerid,-1,"Put Your Message Here");
SendClientMessage(playerid,-1,"Put Your Message Here");
SendClientMessage(playerid,-1,"Put Your Message Here");
SendClientMessage(playerid,-1,"Put Your Message Here");
return 1;
}
I recommend ZCMD, Since its the fastest command processor.


Re: How to Make /rules cmd and other Cmds - emokidx - 16.02.2012

https://sampwiki.blast.hk/wiki/SendClientMessage
search
also u think you are missing a bracket after return 0;


Re: How to Make /rules cmd and other Cmds - caribe88 - 16.02.2012

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/rules", cmdtext, true, 10) == 0)
{
SendCilentMessage(playerid, AnyColor, "1.No teamKilling");
SendCilentMessage(playerid, AnyColor, "2.Other Rules");
SendCilentMessage(playerid, AnyColor, "3.Other Rules");
SendCilentMessage(playerid, AnyColor, "4.Other Rules");
return 1;
}
return 0;
}

*By anycolor you have to define a color usualy for rules people use yellow but its your choice
Here is a list of somoe colors
#define COLOR_BLUE 0x375FFFFF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_MEDBLUE 0x0091FFFF


Re: How to Make /rules cmd and other Cmds - doreto - 16.02.2012

to use this command you need to have ZCMD include
PHP код:
CMD:rules(playerid,params[])
{
    
SendClientMessage(playerid,-1,"No team kill ect...");
    
//-1 change this to your color code
    //change message here "   "
    
return true;




Re: How to Make /rules cmd and other Cmds - Slash_ - 16.02.2012

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     if(!strcmp(cmdtext, "/mycmd")) 
     {
        SendClientMessage(playerid, 0xFFFFFFFF, "Hello Player!");
        return 1;
     }
     return 0;
}



Re: How to Make /rules cmd and other Cmds - Konstantinos - 16.02.2012

Quote:
Originally Posted by caribe88
Посмотреть сообщение
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/rules", cmdtext, true, 10) == 0)
{
SendCilentMessage(playerid, AnyColor, "1.No teamKilling");
SendCilentMessage(playerid, AnyColor, "2.Other Rules");
SendCilentMessage(playerid, AnyColor, "3.Other Rules");
SendCilentMessage(playerid, AnyColor, "4.Other Rules");
return 1;
}
return 0;
}

*By anycolor you have to define a color usualy for rules people use yellow but its your choice
Here is a list of somoe colors
#define COLOR_BLUE 0x375FFFFF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_MEDBLUE 0x0091FFFF
Quote:
Originally Posted by Littlehelper[MDZ]
Посмотреть сообщение
Код:
if(strcmp("/rules",cmdtext,true, 10) == 0)
{
SendClientMessage(playerid,-1,"Put Your Message Here");
SendClientMessage(playerid,-1,"Put Your Message Here");
SendClientMessage(playerid,-1,"Put Your Message Here");
SendClientMessage(playerid,-1,"Put Your Message Here");
return 1;
}
I recommend ZCMD, Since its the fastest command processor.
Guys, /rules are 6 Characters not 10.
@ [Cali]ChrOnic_T
pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if( !strcmp( cmdtext, "/rules", true ) )
    {
        SendClientMessage( playerid, -1, "My first rule!");
        return 1;
    }
    // Rest of Commands.
    return 0;
}
By the way I suggest you to read some tutorials on how to use zcmd because it's better than strcmp.
All you have to do is:
pawn Код:
CMD:rules( playerid, params[ ] )
{
    SendClientMessage( playerid, -1, "My first rule!");
    return 1;
}