更糟
指令沒有上層FUNCTION
複製程式
#include <amxmodx>
#include <cstrike>
#include <engine>
#define PLUGIN "buyzone spr"
#define VERSION "1.0"
#define AUTHOR "no"
new g_MsgID
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
g_MsgID = get_user_msgid("StatusIcon")
}
public client_PreThink(id) {
if (cs_get_user_buyzone(id))
{
message_begin(MSG_ONE, g_MsgID, {0,0,0}, id)
write_byte(1) // status
write_string("buyzone") // sprite name
write_byte(255) // red
write_byte(255) // green
write_byte(255) // blue
message_end()
}
else
{
message_begin(MSG_ONE, g_MsgID, {0,0,0}, id)
write_byte(0) // status
write_string("buyzone") // sprite name
write_byte(150) // red
write_byte(150) // green
write_byte(150) // blue
message_end()
}
}