AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [req fix,idea]simple short code (https://forums.alliedmods.net/showthread.php?t=183283)

kileedyg 04-20-2012 05:22

[req fix,idea]simple short code
 
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 :)

labas987 04-20-2012 09:11

Re: [req fix,idea]simple short code
 
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
    }
}


kileedyg 04-20-2012 13:12

Re: [req fix,idea]simple short code
 
@labas987

Thanks its working! ,also about multilanguage - the topic is still alive :)))

fysiks 04-21-2012 01:12

Re: [req fix,idea]simple short code
 
Quote:

Originally Posted by kileedyg (Post 1693042)
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



All times are GMT -4. The time now is 07:40.

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