How to Make /rules cmd and other Cmds
#1

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

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

Код:
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.
Reply
#4

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

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

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;

Reply
#7

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)