Raised This Month: $ Target: $400
 0% 

The code is correct?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
zenok
New Member
Join Date: Aug 2010
Old 12-31-2011 , 08:12   The code is correct?
Reply With Quote #1

I'm starting with the programming of plugins and wanted to know if this is OK:

Code:
public donate(id,ammount,user)
{
//User ammo
new user1_ammo = zp_get_user_ammo_packs(id)
new user2_ammo = zp_get_user_ammo_packs(user)

if(user1_ammo >= ammount){
new user1_restar = user1_ammo-ammount
new user2_sumar = user2_ammo+ammount

zp_set_user_ammo_packs(id,user1_restar)
zp_set_user_ammo_packs(user,user2_sumar)

client_print(id, print_chat, "[ZP] "+ammont+" ammo give to "+user+"")
client_print(user, print_chat, "[ZP] Have you received "+ammont+" from "+id+"")
}else{
client_print(id, print_chat, "[ZP] You don't have enough Ammo Pack")
}

}

Last edited by zenok; 12-31-2011 at 08:15.
zenok is offline
 



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 16:28.


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