SA-MP Forums Archive
commands - 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: commands (/showthread.php?tid=413799)



commands - pelani - 06.02.2013

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.


Re: commands - LarzI - 06.02.2013

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.


Re: commands - pelani - 06.02.2013

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


Re: commands - LarzI - 06.02.2013

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!


Re: commands - Jeffry - 06.02.2013

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


Re: commands - LarzI - 06.02.2013

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?


Re: commands - Jeffry - 06.02.2013

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. ^^


Re: commands - LarzI - 06.02.2013

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!


Re: commands - pelani - 06.02.2013

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


Re: commands - LarzI - 06.02.2013

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.