絕影華
|
分享:
▼
x0
|
[1.6][插件] 另一購買速度問題
我整了一個速度上升給人家買 可以把速度加到500 可惜整出來了後...買了後沒問題 但轉換武器後就會變回正常速度- -
其實我想把它變成買了後用什麼槍都會500速 , 而回合過後才變回正常
new pcvarSpeed
public plugin_init() { register_clcmd("say /shop", "mostrarmenu") pcvarSpeed = register_cvar("super_speed", "500") }
public mostrarmenu(id) { new menu = menu_create("\y 商店\r(1回合):", "mostrar_cliente") menu_additem(menu, "\r 速度上升", "1", 0) menu_display(id, menu, 0) } }
public mostrar_cliente(id, menu, item, Float:damage) { new data[6], iName[64] new access, callback menu_item_getinfo(menu, item, access, data,5, iName, 63, callback) new key = str_to_num(data) switch(key) { case 1:{ if(cs_get_user_money(id) >= 8000) { { set_user_maxspeed(id, get_pcvar_float(pcvarSpeed)) cs_set_user_money(id,cs_get_user_money(id) - 8000) return PLUGIN_HANDLED } } else { client_print(id, print_chat, "[商店]你不夠金錢購買") } } } menu_destroy(menu) return PLUGIN_HANDLED }
|
|
x0
[樓 主]
From:香港和記電訊 | Posted:2011-07-21 16:51 |
|
|
andyt0621
|
分享:
▲
複製程式
new pcvarSpeed, g_used[33]
public plugin_init()
{
register_clcmd("say /shop", "mostrarmenu")
pcvarSpeed = register_cvar("super_speed", "500")
}
public mostrarmenu(id)
{
new menu = menu_create("\y 商店\r(1回合):", "mostrar_cliente")
menu_additem(menu, "\r 速度上升", "1", 0)
menu_display(id, menu, 0)
}
public mostrar_cliente(id, menu, item, Float:damage)
{
new data[6], iName[64]
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:{
if(cs_get_user_money(id) >= 8000)
{
{
g_used[id] = 1
set_user_maxspeed(id, get_pcvar_float(pcvarSpeed))
cs_set_user_money(id,cs_get_user_money(id) - 8000)
return PLUGIN_HANDLED
}
}
else
{
client_print(id, print_chat, "[商店]你不夠金錢購買")
}
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
public client_PreThink(id)
{
if (!is_user_alive(id)) return
if (g_used[id])
entity_set_float(id, EV_FL_maxspeed, get_pcvar_float(pcvarSpeed))
}
樓主要多看看別人的作品啊 =.=
|
|
x0
[9 樓]
From:歐洲 | Posted:2011-07-22 11:31 |
|
|
|