Raised This Month: $ Target: $400
 0% 

Request random score plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mahmoodi.1313
Senior Member
Join Date: Aug 2014
Location: Steamboat Springs, USA
Old 05-11-2015 , 02:54   Request random score plugin
Reply With Quote #1

Hi,
I need to score a random plugin .
Random server to players and bots score between 0 to 20.
,Ty
mahmoodi.1313 is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 05-11-2015 , 03:51   Re: Request random score plugin
Reply With Quote #2

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)

Attached Files
File Type: sma Get Plugin or Get Source (random_score.sma - 548 views - 274 Bytes)
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
mahmoodi.1313
Senior Member
Join Date: Aug 2014
Location: Steamboat Springs, USA
Old 05-11-2015 , 10:13   Re: Request random score plugin
Reply With Quote #3

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.
mahmoodi.1313 is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 05-11-2015 , 10:16   Re: Request random score plugin
Reply With Quote #4

Quote:
Originally Posted by mahmoodi.1313 View Post
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().
__________________
Shiina.Mashiro is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 05-11-2015 , 10:49   Re: Request random score plugin
Reply With Quote #5

Quote:
Originally Posted by mahmoodi.1313 View Post
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

Edit: now what you have to do
make one roundstart event
make random 0 20 and set frag so everytime frag will change
__________________
Thanks everyone. #miss_you_all

Last edited by indraraj striker; 05-11-2015 at 10:50.
indraraj striker is offline
mahmoodi.1313
Senior Member
Join Date: Aug 2014
Location: Steamboat Springs, USA
Old 05-11-2015 , 13:23   Re: Request random score plugin
Reply With Quote #6

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.
mahmoodi.1313 is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 05-11-2015 , 13:50   Re: Request random score plugin
Reply With Quote #7

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)   
    


Attached Files
File Type: sma Get Plugin or Get Source (random_scorev1.sma - 549 views - 488 Bytes)
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
Reply



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 20:01.


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