I'm making a plugin where it makes it where a player cant drive from admin powers. I'm having one little problem tho trying to block them from driving. It revokes and unrevokes fine but it never actually blocks them from driving and i found out pfn_use() isnt being called because with my debug sayings, it says nothing at all. Does anyone know why it wont be called?
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
public plugin_init() {
register_plugin("License Handler","1.0","Johnjg75")
register_concmd("amx_revoke","revoke",ADMIN_KICK,"<player> - Revokes the player's license")
register_concmd("amx_unrevoke","unrevoke",ADMIN_KICK,"<player> - Renews a player's license")
}
public pfn_use(user,used)
{
client_print(0,print_chat,"LEVEL 0 REACHED") // level 0
//if(!is_valid_ent(user) || !is_valid_ent(used))
//return PLUGIN_CONTINUE
new entname[32]
entity_get_string(used,EV_SZ_targetname,entname,31)
if(strcmp(entname,"func_vehicle",1))
{
new playerauth[40]
client_print(0,print_chat,"LEVEL 1 REACHED")// Level 1
get_user_authid(user,playerauth,39)
new vaultauth[50]
format(vaultauth,49,"RV%s",playerauth)
if(vaultdata_exists(vaultauth))
{
client_print(0,print_chat,"LEVEL 2 REACHED") // Level 2
return PLUGIN_HANDLED
}
}
client_print(0,print_chat,"ERROR")
return PLUGIN_CONTINUE
}
public revoke(id)
{
new playern[42]
read_argv(1,playern,41)
new playerid = find_player("b",playern)
if(!playerid)
{
client_print(id,print_console,"Sorry, this user is not found.")
return PLUGIN_CONTINUE
}
new playerauth[40]
get_user_authid(playerid,playerauth,39)
new vaultauth[50]
format(vaultauth,49,"RV%s",playerauth)
set_vaultdata(vaultauth,"1")
client_print(id,print_console,"Player's license revoked.")
return PLUGIN_CONTINUE
}
public unrevoke(id)
{
new playern[42]
read_argv(1,playern,41)
new playerid = find_player("b",playern)
if(!playerid)
{
client_print(id,print_console,"Sorry, this user is not found.")
return PLUGIN_CONTINUE
}
new playerauth[40]
get_user_authid(playerid,playerauth,39)
new vaultauth[50]
format(vaultauth,49,"RV%s",playerauth)
if(!vaultdata_exists(vaultauth))
{
client_print(id,print_console,"Player's license was never revoked.")
return PLUGIN_CONTINUE
}
if(vaultdata_exists(vaultauth))
{
remove_vaultdata(vaultauth)
client_print(id,print_console,"This player's license was unrevoked.")
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}