Quote:
Originally Posted by YamiKaitou
Please provide the entire code
|
This is the entire code:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <unlimited_money>
#define PLUGIN "No Footsteps"
#define VERSION "1.0"
#define AUTHOR "AMXX Community"
new foot[33]
new g_dp_access
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("dp_cost", "1000")
register_event("ResetHUD","RoundStart","b")
register_clcmd("say /foot","ShowPayForItMenu")
register_forward ( FM_Touch, "Fwd_Touch" )
g_dp_access = register_cvar("amx_dp_access", "c");
}
public ShowPayForItMenu(id) {
new iAccess[32];
get_pcvar_string(g_dp_access, iAccess, 31);
if(get_user_flags(id) & read_flags(iAccess) == 0)
{
new msg[256]
format(msg, 255, "^x04銆恀x03闈欐鍗x01@^x03鎻愮ず^x04銆慯x01瀵逛笉璧?鍙湁^x03浼氬憳^x01鎵嶈兘璐拱^x04銆愰潤姝ュ崱銆慯x04.")
client_color(id, id, msg)
return PLUGIN_CONTINUE
}
if(!is_user_alive(id)) {
new msg[256]
format(msg, 255, "^x04銆恀x03闈欐鍗x01@^x03鎻愮ず^x04銆慯x01瀵逛笉璧?鍙湁^x04娲荤潃^x01鎵嶈兘璐拱^x04銆愰潤姝ュ崱銆慯x01.")
client_color(id, id, msg)
return PLUGIN_HANDLED
}
if(foot[id] > 0){
new msg[256]
format(msg, 255, "^x04銆恀x03闈欐鍗x01@^x03鎻愮ず^x04銆慯x01瀵逛笉璧穅x01,浣犲凡璐拱浜哵x04銆愰潤姝ュ崱銆慯x01,涓嶈兘鍐峖x04璐拱^x01浜?")
client_color(id, id, msg)
return PLUGIN_CONTINUE
}
new money = cs_get_user_money2(id)
new dpcost = get_cvar_num("dp_cost")
if(money < dpcost) {
new msg[256]
format(msg, 255, "^x04銆恀x03闈欐鍗x01@^x03鎻愮ず^x04銆慯x01瀵逛笉璧穅x01,浣犳矑鏈夎冻澶犵殑^x04閲戦挶^x01璐拱^x04銆愰潤姝ュ崱銆慯x01.")
client_color(id, id, msg)
}
else
{
foot[id] = 1
cs_set_user_money2(id, money - dpcost)
new player_name[32]
get_user_name(id, player_name, 31)
new msg[256]
format(msg, 255, "^x04銆恀x03闈欐鍗x01@^x03鎻愮ず^x04銆慯x01鎭枩^x03%s^x01鎴愬姛璐拱浜嗕竴涓猑x04銆愰潤姝ュ崱銆慯x01,瑕佸皬蹇冨摝!", player_name)
client_color(0, id, msg)
}
return PLUGIN_CONTINUE
}
public Fwd_Touch(id)
{
if(foot[id] == 0)
{
return PLUGIN_CONTINUE
}
if(is_user_alive(id))
set_user_footsteps(id,1)
return FMRES_IGNORED
}
public RoundStart(id)
{
foot[id] = 0
}
public client_color(playerid, colorid, msg[])
{
message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),_,playerid)
write_byte(colorid)
write_string(msg)
message_end()
}
/* AMXX-Studio浠g爜涓嶈兘浣庝笌杩欓噷 杞欢姹夊寲SiMen.K.
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
*/