Raised This Month: $ Target: $400
 0% 

Help please


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
extreem
Member
Join Date: Apr 2011
Location: Czech Republick
Old 04-18-2011 , 16:47   Help please
Reply With Quote #1

HI. Can you halp me.
I am new in scripting and want know where I must use that - %d, %s and ohter in client print. I can't find it.
I make my first plugin (or remake)
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <colorchat>

#define PLUGIN "sayomg"
#define VERSION "1.0"
#define AUTHOR "Extreem"
new p_URL
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /rs""reset_score")
    
register_clcmd("say /resetscore""reset_score")
    
p_URL register_cvar("web_url","URL")
    
}
public 
reset_score(id)
{
    
cs_set_user_deaths(id0)
    
set_user_frags(id0)
    
cs_set_user_deaths(id0)
    
set_user_frags(id0)
    new 
name[33]
    
get_user_name(idname32)
    
ColorChat(0NORMAL"^1%s Player^4 %s^x01 reset score with usig command ^4 /rs"p_URLname)
}
public 
client_putinserver(id)
{
        
set_task(10.0"connectzprava"id__"a"1)
}
public 
connectzprava(id)
{
    new 
name[33]
    
get_user_name(idname32)
    if(
is_user_connected(id))
    {
    
ColorChat(idNORMAL"^1%s Dear^4 %s^1, for resetscore use command ^4/rs",p_URLname)
    }

And in chat I have that
Code:
sayomg Player Extreem reset score with usig command /rs
__________________
extreem is offline
Send a message via Skype™ to extreem
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-18-2011 , 18:27   Re: Help please
Reply With Quote #2

You have to use

PHP Code:
new some_string_here[50]
get_pcvar_string(p_URLsome_string_herecharsmax(some_string_here)) 
Then use some_string_here in client_print() where you have p_URL.
__________________
fysiks is offline
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 04-18-2011 , 20:55   Re: Help please
Reply With Quote #3

%s means string
%d and %i are the same, means integer (number)

so, if you use get_cvar_string for example, you must use %s and for get_cvar_num you must use %i
DjOptimuS is offline
extreem
Member
Join Date: Apr 2011
Location: Czech Republick
Old 04-19-2011 , 10:21   Re: Help please
Reply With Quote #4

fysiks, thanx for kode.
DjOptimus, where I can read all rules of that ?
__________________
extreem is offline
Send a message via Skype™ to extreem
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-19-2011 , 18:44   Re: Help please
Reply With Quote #5

Quote:
Originally Posted by extreem View Post
DjOptimus, where I can read all rules of that ?
It's similar to the printf() function from C++. Google it. Not everything will work though, so don't expect everything to work when coding with AMX Mod X.
__________________
fysiks is offline
Reply



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 20:12.


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