Raised This Month: $32 Target: $400
 8% 

Solved [HELP]Bug Donate points


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ms.itry
Member
Join Date: Apr 2018
Old 04-17-2018 , 15:56   [HELP]Bug Donate points
Reply With Quote #1

hi everone
i have this scripting for transfer points with other players
but i find this bug

i can send how much points to my self

Code:
#include <amxmodx>  
#include <amxmisc>  
#include <cstrike>  
#include <hamsandwich>  
#include <colorchat>
#include <fun>  
  

#pragma dynamic 32768   
#define is_valid_player(%1) (1 <= %1 <= 32)   

#define NICK    
  
native dh_get_point(id)
native dh_set_point(id, amount)

public plugin_init()  
{  
    register_plugin("Bank Menu","1.0","noone")  

    register_clcmd("transfer", "transfer_ammo", ADMIN_ALL, "")

      
}  
public transfer_ammo(id)
{    
new param[6]    
read_argv(2, param, charsmax(param))

for (new x; x < strlen(param); x++)    
{       
if(!isdigit(param[x]))       
 {            
set_hudmessage(255, 0, 0, -1.0, 0.4, 0, 0.0, 5.0, 1.0, 1.0, false)            
show_hudmessage(id,"")            
return 0        
}    
}    
   
new amount = str_to_num(param)   
    
new ammo = dh_get_point(id) 

if (ammo < amount)    
{             
ChatColor(id,"^4[M#G] ^1You Don't Have Enough Ammopacks !")       
return 0    
} 
      
read_argv(1, param, charsmax(param))   
new player = str_to_num(param) 
      
new player_ammo = dh_get_point(player)

dh_set_point(id, ammo - amount)    
dh_set_point(player, player_ammo + amount)    
   
new names[2][32]        

get_user_name(id, names[0], 31) 
   
get_user_name(player, names[1], 31)        
ColorChat(0, GREY, "^4[M#G] ^1Player ^4 %s  ^1Donated ^4%d ^1Ammopaks To Player ^4%s ^1!", names[0], amount, names[1]) 
return 0
}  

stock ChatColor(const id, const input[], any:...)
{
	new count = 1, players[ 32 ]
	static msg[ 191 ]
	vformat( msg, 190, input, 3 )	
	replace_all( msg, 190, "!g", "^4" )
	replace_all( msg, 190, "!y", "^1" )
	replace_all( msg, 190, "!t", "^3" )	
	if(id) players[ 0 ] = id; else get_players( players, count, "ch" )
	{
	for(new i = 0; i < count; i++)
	{
		if( is_user_connected( players[ i ] ) )
		{
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[ i ] )  
			write_byte( players[ i ] )
			write_string( msg )
			message_end( )
		}
	}
}
}

Last edited by ms.itry; 04-19-2018 at 17:27.
ms.itry is offline
ms.itry
Member
Join Date: Apr 2018
Old 04-19-2018 , 15:37   Re: [HELP]Bug Donate points
Reply With Quote #2

I beg you people i need this help really
i need to fix that bug (send points to self)
like someone if he try to send points to his self the transfer dont complete
ms.itry is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 04-19-2018 , 15:58   Re: [HELP]Bug Donate points
Reply With Quote #3

if (equal(id, player) != -1)
return 1

Right after:
new player = str_to_num(param)
__________________
Relaxing is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-19-2018 , 16:40   Re: [HELP]Bug Donate points
Reply With Quote #4

Quote:
Originally Posted by Relaxing View Post
if (equal(id, player) != -1)
return 1

Right after:
new player = str_to_num(param)
No, id nor player are strings/arrays, its if(id == player)
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 04-19-2018 at 16:40.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
ms.itry
Member
Join Date: Apr 2018
Old 04-19-2018 , 16:51   Re: [HELP]Bug Donate points
Reply With Quote #5

Quote:
Originally Posted by Relaxing View Post
if (equal(id, player) != -1)
return 1

Right after:
new player = str_to_num(param)
i was follow what you said

can you try again help me please

Last edited by ms.itry; 04-19-2018 at 16:52.
ms.itry is offline
ms.itry
Member
Join Date: Apr 2018
Old 04-19-2018 , 17:25   Re: [HELP]Bug Donate points
Reply With Quote #6

thank guys i have find it
ms.itry 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 21:48.


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