Raised This Month: $ Target: $400
 0% 

[req fix,idea]simple short code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kileedyg
BANNED
Join Date: Dec 2008
Location: Lithuania
Old 04-20-2012 , 05:22   [req fix,idea]simple short code
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define adminas ADMIN_KICK
#define seimininkas ADMIN_IMMUNITY
public plugin_init() {
 
register_plugin("whatever","whatever","noone")
 
register_event("HLTV""event_new_round""a""1=0""2=0")
 
register_dictionary("whatever.txt")
 
register_clcmd("say /t""t")
 
register_clcmd("say_team /t""t")
 
register_clcmd("say /ct""ct")
 
register_clcmd("say_team /ct""ct")
 
register_clcmd("say /s""s")
 
register_clcmd("say_team /s""s")
}
public 
event_new_round(id) {
if (
is_user_alive(id)&&get_user_flags(id)&adminas)  
 
client_print(0,print_chat,"%L",LANG_PLAYER,"INFO_ADMIN"// noredamas stebeti pazeidejus rasyk /s
if (is_user_alive(id)&&get_user_flags(id)&seimininkas
 
client_print(0,print_chat,"%L",LANG_PLAYER,"INFO_SEIMINKAS"// //Noredamas pakeisti komanda naudokis /ct jei nori grysti i CT /t jei nori grytsi i T naudokis  /s jei vel nori tapti ziurovu
}
public 
t(id) {
    if(
cs_get_user_team(id) == CS_TEAM_T)
    else if 
seimininkas
    client_print
(id,print_chat,"%L",LANG_PLAYER,"JAU_ESI_T"); // tu jau esi t
    
else 
{
    if(!
is_user_alive(id))
    
cs_set_user_team(id,CS_TEAM_T);
}
    else 
{
    
client_cmd(id,"kill")
    
cs_set_user_team(id,CS_TEAM_T);

}
public 
ct(id) {
    if(
cs_get_user_team(id) == CS_TEAM_CT)
    else if 
seimininkas
    client_print
(id,print_chat,"%L",LANG_PLAYER,"JAU_ESI_CT");  // tu jau esi ct
    
else 
{
        if(!
is_user_alive(id))
        
cs_set_user_team(id,CS_TEAM_CT);
}
    else 
{
        
client_cmd(id,"kill")
        
cs_set_user_team(id,CS_TEAM_CT);
    
}
public 
s(id) {
    if(!
is_user_alive(id))
    else if 
adminas
    cs_set_user_team
(id,CS_TEAM_CT);
    else 
{
    
client_cmd(id,"kill")
    
cs_set_user_team(id,CS_TEAM_SPECTATOR);
}
    else 
client_print(id,print_chat,"%L",LANG_PLAYER,"INFO"); //Noredamas pakeisti komanda naudokis /ct jei nori grysti i CT /t jei nori grytsi i T naudokis  /s jei vel nori tapti ziurovu
}
 
 return 
0;

Can someone fix it please, and one more thing is it possible to respawn using command /t,/ct user defined as adminas only in new round, and leave respawn anytime for user defined as seimininkas?
thankies fellows ,also is it possible to make,example:
PHP Code:
client_print(id,print_chat,"%L %s %L",LANG_PLAYER,seconds,LANG_PLAYER,"Y_W_B_K","seconds")// Text look like -  You will be kicked in %s seconds 
I mean multiple multilang,please give me example

Last edited by kileedyg; 04-20-2012 at 05:35. Reason: another fixez
kileedyg is offline
Send a message via Skype™ to kileedyg
Old 04-20-2012, 09:07
hleV
This message has been deleted by hleV.
labas987
New Member
Join Date: Dec 2010
Old 04-20-2012 , 09:11   Re: [req fix,idea]simple short code
Reply With Quote #2

I'm not sure, but...
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define ADMINAS ADMIN_KICK
#define SEIMININKAS ADMIN_IMMUNITY

public plugin_init() 
{
    register_plugin("whatever", "whatever", "noone");
    register_logevent("round_start", 2, "1=Round_Start")
    
    register_dictionary("whatever.txt");
    
    register_clcmd("say /t", "t");
    register_clcmd("say_team /t", "t");
    register_clcmd("say /ct", "ct");
    register_clcmd("say_team /ct", "ct");
    register_clcmd("say /s", "s");
    register_clcmd("say_team /s", "s");
}

public round_start(id) 
{
    new players[32], pnum, pid;
    get_players(players, pnum, "a");
    
    for(new i; i < pnum; i++)
    {
        pid = players[i]; 
    
        if(is_user_alive(pid) && get_user_flags(pid) & ADMINAS)  
            client_print(0, print_chat, "%L", LANG_PLAYER, "INFO_ADMIN"); // noredamas stebeti pazeidejus rasyk /s
            
        if(is_user_alive(pid) && get_user_flags(pid) & SEIMININKAS) 
            client_print(0, print_chat, "%L", LANG_PLAYER, "INFO_SEIMINKAS"); // //Noredamas pakeisti komanda naudokis /ct jei nori grysti i CT /t jei nori grytsi i T naudokis  /s jei vel nori tapti ziurovu
    }
}

public t(id)
{
    if(get_user_flags(id) & SEIMININKAS)
        return;
        
    if(cs_get_user_team(id) == CS_TEAM_T)
    {
        client_print(id, print_chat, "%L", LANG_PLAYER, "JAU_ESI_T"); // tu jau esi t
        return;
    }
    
    if(is_user_alive(id))
        user_kill(id);
            
    cs_set_user_team(id, CS_TEAM_T);
}
public ct(id) 
{
    if(!(get_user_flags(id) & SEIMININKAS))
        return;
        
    if(cs_get_user_team(id) == CS_TEAM_CT)
    {
        client_print(id, print_chat, "%L", LANG_PLAYER, "JAU_ESI_CT"); // tu jau esi ct
        return;
    }
    
    if(is_user_alive(id))
        user_kill(id);
            
    cs_set_user_team(id, CS_TEAM_CT);
}

public s(id)
{
    if(!is_user_alive(id))
        return;
    
    if(get_user_flags(id) & ADMINAS)
    {
        if(is_user_alive(id))
            user_kill(id);
        
        cs_set_user_team(id, CS_TEAM_SPECTATOR);
    
        client_print(id, print_chat, "%L", LANG_PLAYER, "INFO"); //Noredamas pakeisti komanda naudokis /ct jei nori grysti i CT /t jei nori grytsi i T naudokis  /s jei vel nori tapti ziurovu
    }
}
labas987 is offline
kileedyg
BANNED
Join Date: Dec 2008
Location: Lithuania
Old 04-20-2012 , 13:12   Re: [req fix,idea]simple short code
Reply With Quote #3

@labas987

Thanks its working! ,also about multilanguage - the topic is still alive ))
kileedyg is offline
Send a message via Skype™ to kileedyg
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-21-2012 , 01:12   Re: [req fix,idea]simple short code
Reply With Quote #4

Quote:
Originally Posted by kileedyg View Post
Thanks its working! ,also about multilanguage - the topic is still alive ))
I'm guessing that you would need to format each one individually into one buffer string and then print the buffer string:

PHP Code:
new szBuffer[128], len 0
len 
format(szBuffercharsmax(szBuffer), "%L", ...)
format(szBuffercharsmax(szBuffer) - len"%L", ...)
client_print(idprint_chatszBuffer
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 07:40.


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