Unfortunately, same effect:
Code:
new bool:g_cantUseTrain[ 33 ] = false
public plugin_init() {
register_concmd("amx_test","test",ADMIN_KICK)
RegisterHam(Ham_Use, "func_vehicle", "train", 1);
}
public train(ent, id) {
if (g_cantUseTrain[id])
{
ExecuteHamB(Ham_Use, ent, 0, 1, 0, 0);
static buttons, msgTrain;
buttons = pev(id, pev_button);
if (buttons & IN_USE)
{
set_pev(id, pev_button, buttons & ~IN_USE);
set_pev(id, pev_oldbuttons, pev(id, pev_oldbuttons) | IN_USE);
}
message_begin(MSG_ONE, (msgTrain ? msgTrain : (msgTrain = get_user_msgid("Train"))), _, id);
write_byte(0);
message_end();
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public test() {
g_cantUseTrain[1] = true
return PLUGIN_HANDLED
}