Sunt sigur ca ati intr-un plugin variabile.Sunt cele cu new.Dupa cum le spun si numele ele "variaza",adica puteti sa le dati orice valori.
De exemplu :
Code:
new ping = get_user_ping(id,ping,loss)
Variabilele se folosec la evenimente cu bomba(plantarea,dezamorsarea,scaparea,ridicarea acesteia)
Code:
new name[32]
get_user_name(id,name,31)
set_hudmessage(255,0,0, 0.04, 0.47, 0, 6.0, 7.0)
show_message(0, "%s a plantat bomba !",name)
Desigur intr-un event.
Pentru plantare:
Code:
register_event("TextMsg", "bomb_planted", "a", "2&%!MRAD_BOMBPL")
Pentru dezamorsare :
Code:
register_event("TextMsg", "bomb_defused", "a", "2&%!MRAD_BOMBDEF")
Exemplu pentru plantare si dezamorsare
Code:
#include <amxmodx>
#include <amxmisc>
#include <csx>
public plugin_init(){
register_plugin("new plugin","1.0","autor")
register_event("TextMsg", "bomb_planted", "a", "2&%!MRAD_BOMBPL")
register_event("TextMsg", "bomb_defused", "a", "2&%!MRAD_BOMBDEF")
}
public bomb_planted(id){
new name[32]
get_user_name(id,name,31)
set_hudmessage(255,0,0, 0.04, 0.47, 0, 6.0, 7.0)
show_message(0, "%s a plantat bomba !",name)
}
public bomb_defused(id){
new name[32]
get_user_name(id,name,31)
set_hudmessage(255,0,0, 0.04, 0.47, 0, 6.0, 7.0)
show_message(0, "%s a dezamorsat bomba !",name)
}
M-am vam abatut de la subiect dar ideea era sa intelegeti mai bine ce si cum.
Alte variabile folosite des :
new hp = get_user_health(id)
new frags = get_user_frags(id)
new deaths = get_user_deaths(id)
GL & HF