AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   HELP|with plugin (https://forums.alliedmods.net/showthread.php?t=167807)

Mr_Boris 09-20-2011 12:05

HELP|with plugin
 
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

xDrugz 09-20-2011 13:32

Re: HELP|with plugin
 
Use "Said" Function

Dr7sTyLe 09-20-2011 13:35

Re: HELP|with plugin
 
Quote:

Originally Posted by xDrugz (Post 1559569)
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

e12harry 09-21-2011 03:55

Re: HELP|with plugin
 
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 



Mr_Boris 09-21-2011 07:26

Re: HELP|with plugin
 
thx se this to http://forums.alliedmods.net/showthr...66#post1559966


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

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