public cmd_mreset(id){for(new i; i<count; i++){
cs_set_user_deaths(players[i], 0)
set_user_frags(players[i], 0)client_print(0, print_center,"[ADMIN] Score reset on next spawn")}}
I suggest making a new variable and then equalling it to the players[i] (create the variable before the loop) as this will prevent the compiler from overflowing (I read it HERE)
Code:
public cmd_mreset(id){new players[32], count, player
get_players(players, count, "h")for(new i; i<count; i++){
player = players[i]
set_user_frags(player, 0)
cs_set_user_deaths(player, 0)client_print(0, print_center,"[ADMIN] Score reset on next spawn")// Why the index is 0 if you are looping?// it will show you the message many times as the number of players// if you just put the index to player it will print to all players // as you are collecting all (Dead+alive) from get_players()}}
Also this
Spoiler
Code:
public cmd_giveme(id){new money = cs_get_user_money(id)// making a variable that stores a player's money// is better than executing the native like 4 timesif(is_user_alive(id)&& money >=2000){client_cmd(id, "spk misc/objective.wav")
cs_set_user_money(id, money -2000, 1)
strip_user_weapons(id)// Give Weapons
give_item(id,"weapon_knife")
give_item(id,"weapon_deagle")
give_item(id, "weapon_hegrenade")switch(cs_get_user_team(id))// Better than making if condition 2 times{case CS_TEAM_CT:{
give_item(id, "weapon_m4a1")
cs_set_user_bpammo(id,22,150)}case CS_TEAM_T:{
give_item(id, "weapon_ak47")
cs_set_user_bpammo(id,28,150)}}// Give Ammo
cs_set_user_bpammo(id,26,50)
cs_set_user_model(id,"vip")}else{if(is_user_alive(id)&& money < 2000){client_print(id, print_chat, "[WEAPONARY] Not enough money dude,Come back later!")}elseif(!is_user_alive(id)){client_print(id, print_chat, "[MEDIC] You are dead!")client_print(id, print_chat, "[MEDIC] Cannot give weapons to dead players")}}}
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
Last edited by pokemonmaster; 06-24-2012 at 03:59.