AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Request random score plugin (https://forums.alliedmods.net/showthread.php?t=262724)

mahmoodi.1313 05-11-2015 02:54

Request random score plugin
 
Hi,
I need to score a random plugin .
Random server to players and bots score between 0 to 20.
,Ty

indraraj striker 05-11-2015 03:51

Re: Request random score plugin
 
1 Attachment(s)
here you go:
PHP Code:

#include <amxmodx>
#include <fun>

public client_putinserver(id)
{
    
set_task(3.0,"rand_score",id)
}

public 
rand_score(id)
{
    new 
rand;
    
rand random_num(0,20)
    
set_user_frags(id,rand);
    
//client_print(id,print_chat,"Your frag has been set to %i",rand)



mahmoodi.1313 05-11-2015 10:13

Re: Request random score plugin
 
It works. But the score is always constant.
If so that every few minutes one or two player whose score changed .
Sorry for the bad English.

Shiina.Mashiro 05-11-2015 10:16

Re: Request random score plugin
 
Quote:

Originally Posted by mahmoodi.1313 (Post 2295559)
It works. But the score is always constant.
If so that every few minutes one or two player whose score changed .
Sorry for the bad English.

I don't see anything wrong with his code.
If you want to change the score later, you can change the seconds in the set_task().

indraraj striker 05-11-2015 10:49

Re: Request random score plugin
 
Quote:

Originally Posted by mahmoodi.1313 (Post 2295559)
It works. But the score is always constant.
If so that every few minutes one or two player whose score changed .
Sorry for the bad English.

it will change after round end or else you have to kill one player or death :3

Edit: now what you have to do
make one roundstart event :3
make random 0 20 and set frag :3 so everytime frag will change

mahmoodi.1313 05-11-2015 13:23

Re: Request random score plugin
 
You can adjust in such a way that no end of round or kill one player or death each time change the score ?
Or give a command when I entered random score to give players.

indraraj striker 05-11-2015 13:50

Re: Request random score plugin
 
1 Attachment(s)
now this will give random frag after round start no need kill or death
PHP Code:


#include <amxmodx>  
#include <fun>
 
public plugin_init() {  
    
register_logevent"rand_score"2"1=Round_Start" ); 
}  

public 
rand_score(id)  
{  
    new 
Players[32 ];  
    new 
iNum;  
    new 
id;  
    
get_playersPlayersiNum"h" );  
    for( --
iNumiNum >= 0iNum-- )  
    {  
        
id PlayersiNum ]; 
        new 
rand random_num(0,20
        
set_user_frags(id,rand); 
        
//client_print(id,print_chat,"Your frag has been set to %i",rand)   
    





All times are GMT -4. The time now is 20:01.

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