commands
#1

need a anti caps keys commands for admin.


/caps [id]

Pelani (2) caps has been off.


after player type words on main chat so they all words on small letters until admin uncaps it.
Reply
#2

Under the command assign a bool array for the player to true
pawn Код:
g_bMyBool[ targetid ] = true;
Then check if that bool is set under OnPlayerText, and loop through the string and use https://sampwiki.blast.hk/wiki/Tolower to set each character to lowercase:
pawn Код:
if( g_bMyBool[ playerid ] )
{
    for( new i = 0, j = strlen( text ); i != j; i ++ ) //128 is maximum chat output
    {
        Tolower( text[ i ] );
    }
}
You obviously need to declare and name that bool array all by yourself, but I'm sure you can handle it, as I don't believe you don't have any knowledge at all.
Reply
#3

but i want a cmd for admin, admin can off player caps and they can on
Reply
#4

Well, do you know how to make commands with parameters? If not, you should check out some tutorials. Also adding permissions is really easy, especially if you use y_commands.

I won't give you free code as I want you to learn. You learn by reading. Search for a ycmd or zcmd tutorial in the tutorials section!
Reply
#5

Quote:
Originally Posted by LarzI
Посмотреть сообщение
//128 is maximum chat output
It's 144.
Reply
#6

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
It's 144.
Edit: If this is true, then I stand corrected. Are you completely sure this isn't only for chat bubbles?
Reply
#7

Quote:
Originally Posted by LarzI
Посмотреть сообщение
I stand corrected. It used to be 128 at least.
I made a test on 0.3d few months ago, counted the maximum output and came to 144.
Just sharing. ^^
Reply
#8

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
I made a test on 0.3d few months ago, counted the maximum output and came to 144.
Just sharing. ^^
Very well then!
Reply
#9

will u stop fucking fighting and give me a good cmd?
Reply
#10

Quote:
Originally Posted by pelani
Посмотреть сообщение
will u stop fucking fighting and give me a good cmd?
We're not fighting, and no I would never just give you a "good cmd", and now I won't even bother trying to help you, when you're that aggressive. Have fun finding out on your own.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)