Raised This Month: $ Target: $400
 0% 

HELP|with plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr_Boris
Junior Member
Join Date: Aug 2011
Old 09-20-2011 , 12:05   HELP|with plugin
Reply With Quote #1

I Have this plugin :

PHP Code:
/*=====================================================
                   First Writes
=====================================================*/
public Firstwrites(id

    if(!
is_user_admin(id))
    { 
        
ColorChat(idRED"^4You have no access to that command"
        return 
PLUGIN_HANDLED 
    

     
    
// Random in Normal Color 
    
switch(random_num(0,2)) 
    { 
        case 
0:        set_hudmessage(25500, -1.0, -1.004.54.5// red 
        
case 1:        set_hudmessage(02550, -1.0, -1.004.54.5// green 
        
case 2:        set_hudmessage(00255, -1.0, -1.004.54.5// blue 
    

    
show_hudmessage(0"The First writes will started in 5 seccond"
     
    
set_task(5.0"ActionFirstwrites"
     
    return 
PLUGIN_HANDLED 


public 
ActionFirstwrites() 

    
// Random in Normal Color 
    
switch(random_num(0,3)) 
    { 
        case 
0:        set_hudmessage(25500, -1.00.42// red 
        
case 1:        set_hudmessage(02550, -1.00.42// green 
        
case 2:        set_hudmessage(00255, -1.00.42// blue 
        
case 3:        set_hudmessage(255255255, -1.00.42// white 
    

    switch(
random_num(0,4)) 
    { 
        case 
0: { 
            
show_hudmessage(0"The First writes ^" %^" moves to CT Team"random_num(0,9)) 
        } 
        case 
1: { 
            
show_hudmessage(0"The First writes ^" %d%^" moves to CT Team"random_num(0,9), random_num(0,9)) 
        } 
        case 
2: { 
            
show_hudmessage(0"The First writes ^" %d%d%^" moves to CT Team"random_num(0,9), random_num(0,9), random_num(0,9)) 
        } 
        case 
3: { 
            
show_hudmessage(0"The First writes ^" %d%d%d%^" moves to CT Team"random_num(0,9), random_num(0,9), random_num(0,9), random_num(0,9)) 
        } 
        case 
4: { 
            
show_hudmessage(0"The First writes^" %d%d%d%d%^" moves to CT Team"random_num(0,9), random_num(0,9), random_num(0,9), random_num(0,9), random_num(0,9)) 
        } 
    } 
     
    return 
PLUGIN_HANDLED 

I want First Writes The random word Automatic move to CT team
Mr_Boris is offline
xDrugz
Senior Member
Join Date: Jul 2011
Location: return 4;
Old 09-20-2011 , 13:32   Re: HELP|with plugin
Reply With Quote #2

Use "Said" Function
xDrugz is offline
Dr7sTyLe
Senior Member
Join Date: Dec 2010
Old 09-20-2011 , 13:35   Re: HELP|with plugin
Reply With Quote #3

Quote:
Originally Posted by xDrugz View Post
Use "Said" Function
There is no function "Said", He needs to hook the say event and check who was the first player to write the correct words / numargs
Dr7sTyLe is offline
e12harry
Member
Join Date: Apr 2010
Old 09-21-2011 , 03:55   Re: HELP|with plugin
Reply With Quote #4

Try this (only add yours "Firstwrites" function in plugin_init):
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <colorChat>
#include <cstrike>

new gRandomNum;
new 
gAllowMove;


public 
plugin_init(){
    
register_clcmd("say""handleSay");
}

public 
handleSay(id){
    if(!
gAllowMove)
        return 
PLUGIN_CONTINUE;
    new 
arg[8];
    
    
read_argv(1argcharsmax(arg));
    
remove_quotes(arg);
    if(
is_str_num(arg)){
        if(
gRandomNum == str_to_num(arg)){
            if(
cs_get_user_team(id) != CS_TEAM_CT) {
                
cs_set_user_team(idCS_TEAM_CT); //move to CT
                
gAllowMove 0//stop processing other players
            
}
        }
    }
    return 
PLUGIN_CONTINUE;
}
public 
Firstwrites(id

    if(!
is_user_admin(id))
    { 
        
ColorChat(idRED"^4You have no access to that command"
        return 
PLUGIN_HANDLED 
    

     
gAllowMove 1;
    
// Random in Normal Color 
    
switch(random_num(0,2)) 
    { 
        case 
0:        set_hudmessage(25500, -1.0, -1.004.54.5// red 
        
case 1:        set_hudmessage(02550, -1.0, -1.004.54.5// green 
        
case 2:        set_hudmessage(00255, -1.0, -1.004.54.5// blue 
    

    
show_hudmessage(0"The First writes will started in 5 seccond"
     
    
set_task(5.0"ActionFirstwrites"
     
    return 
PLUGIN_HANDLED 


public 
ActionFirstwrites() 

    
// Random in Normal Color 
    
switch(random_num(0,3)) 
    { 
        case 
0:        set_hudmessage(25500, -1.00.42// red 
        
case 1:        set_hudmessage(02550, -1.00.42// green 
        
case 2:        set_hudmessage(00255, -1.00.42// blue 
        
case 3:        set_hudmessage(255255255, -1.00.42// white 
    

    switch(
random_num(0,4)) 
    { 
        case 
0: { 
            
gRandomNum =  random_num(0,9);
        } 
        case 
1: { 
            
gRandomNum random_num(10,99);
        } 
        case 
2: { 
            
gRandomNum random_num(100,999);
        } 
        case 
3: { 
            
gRandomNum random_num(1000,9999);
        } 
        case 
4: { 
            
gRandomNum random_num(10000,99999);
        } 
    } 
     
show_hudmessage(0"The First writes ^" %^" moves to CT Team"gRandomNum);
    return 
PLUGIN_HANDLED 

e12harry is offline
Mr_Boris
Junior Member
Join Date: Aug 2011
Old 09-21-2011 , 07:26   Re: HELP|with plugin
Reply With Quote #5

thx se this to http://forums.alliedmods.net/showthr...66#post1559966
Mr_Boris 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 19:42.


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