Raised This Month: $ Target: $400
 0% 

green chat/days menu/admin tag help!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
illusionalp
Member
Join Date: Aug 2012
Old 08-28-2012 , 16:37   Re: Scripting Help
Reply With Quote #5

Quote:
Originally Posted by Liverwiz View Post
server_cmd is a function in amxmdx.inc
const szCommand[] is the main parameter (its the command you want to execute inputted as a string)
, any . . . means you're able to put in variables to the previous string.
for example.....
Code:
server_cmd("amx_gravity %d", iGravityToSet)
That's going to take a little bit of experience to do. Its not a simple "Hello World" app. But here's a real simple way of doing it. (not exactly what you want, because i'm lazy and don't want to give you all the answers)
PHP Code:
#include <amxmodx>

#define PLUGIN "Echo"
#define VERSION "1.0"
#define AUTHOR "Liverwiz"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say""handleSay")    // hook say command to handleSay (say is chat in game -default 'y')
}

public 
handleSay(id)
{
    new 
szInput[192]        // 192 is maxlen of text in chat (factoid for you)
    
read_args(szInputcharsmax(szInput) )    // this grabs what the player said
    
remove_quotes(szInput)        // remove quotes so it doesn't get messy
    
    
new szOutput[200], szName[32]    // initialize all variables we're going to use
    
get_user_name(idszNamecharsmax(szName) )
    
        
// This puts the name and input into one string
        // preping to print....
    
formatex(szOutputcharsmax(szOutput), "%s said: %s"szNameszInput)
    
    
client_print(0print_chatszOutput)
    
    return 
PLUGIN_CONTINUE

You should note that the formatex, and consequently szOutput are not required. You can put that directly into the client_print. I only put it there as an example if you were going to go the "SayText" message route, you'll have to use that method.

I wrote a plugin that does soemthing of this nature (plus lots of other crap) its called Private Message. You'll find it in new plugin submissions. It'll give you an example of grabbing text, minipulating it, and printing it using SayText messages
thanks for the reply again,

can you make a simple menu for me ? if yes then
1- change gravity to 30 and slap the username who executed it
2- change gravity to 70 and noclip @ct players
it will be appreciated , i need this menu to learn from it
how you did it , etc..
i will change the functions later
and about the chat plugin can you tell me how can i connect it to a flag like if i had flag x then i can have the [admin] tag before my name

Last edited by illusionalp; 08-28-2012 at 16:38.
illusionalp is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:42.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode