View Single Post
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