Raised This Month: $ Target: $400
 0% 

[Help] Not Enough Points for Play


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tatu Eugen
Member
Join Date: Apr 2010
Old 05-08-2016 , 05:25   [Help] Not Enough Points for Play
Reply With Quote #1

Hello i have a small lottery system and this plugin gets points from player when he enter to play, the problem is get -500 and save -500 in file if player don't have 500 points, i don't want to give -500 in save file, i want if player don't have enough 500 can't join to play... any help? Thanks guys
Code:
public lotto (id) {
	if(zagral[id]) {
		client_print(0,print_chat,"[CSR] Play at every 5 minutes.");
		return PLUGIN_HANDLED;
	}
	Points[id]-=500;
	client_print(id,print_chat,"[CSR] You join, -500 points.");
	set_task(60.0,"kumulacja",id);
         Save(id);
	return PLUGIN_CONTINUE;
}
__________________

Last edited by Tatu Eugen; 05-08-2016 at 05:26.
Tatu Eugen is offline
EpicKiller
Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
Old 05-08-2016 , 07:14   Re: [Help] Not Enough Points for Play
Reply With Quote #2

You could add a check to see if the player has enough credits.

PHP Code:
public lotto(id)
{
    if(
Points[id] < 500)
    {
        
client_print(idprint_chat"You don't have enough credits!");
        
        return 
PLUGIN_HANDLED;
    }
    
    
//...
    //...

__________________
~ Swiftly and with style ~
EpicKiller is offline
Send a message via Yahoo to EpicKiller Send a message via Skype™ to EpicKiller
Tatu Eugen
Member
Join Date: Apr 2010
Old 05-08-2016 , 08:13   Re: [Help] Not Enough Points for Play
Reply With Quote #3

Quote:
Originally Posted by EpicKiller View Post
You could add a check to see if the player has enough credits.

PHP Code:
public lotto(id)
{
    if(
Points[id] < 500)
    {
        
client_print(idprint_chat"You don't have enough credits!");
        
        return 
PLUGIN_HANDLED;
    }
    
    
//...
    //...

Works, thanks man
__________________
Tatu Eugen 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 18:37.


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