i dont no what is wrong. Im doing stuff for my matrix plugin but the following dont work:
heres the plugins... does anyone no whats wrong? (PISSIN ME OFF!!!!
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
new is_matrix[33]
new is_matrix2[33]
public change_matrix(id,level,cid) {
if (!cmd_access(id,level,cid,1)) {
return PLUGIN_CONTINUE
}
new arg[32]
new player
read_argv(1,arg,32)
if(arg[0]) {
player = cmd_target(id,arg,0)
if(!player)
return PLUGIN_HANDLED
}
new name[32]
new admin[32]
new team=get_user_team(player)
get_user_name(player,name,31)
get_user_name(id,admin,31)
if (!is_matrix[player]){
if (team == 1){
if (file_exists("models/player/neo/neo.mdl")==1){
cs_set_user_model(player,"smith")
}
give_item(player,"weapon_deagle")
set_hudmessage( 0, 200, 0, -1.0, -1.0, 0, 6.0, 6.0, 0.5, 1.5, 4 )
show_hudmessage(player, "You have Entered the Matrix!")
console_print(id,"%s has entered the Matrix",name)
}else if (team == 2){
if (file_exists("models/player/neo/neo.mdl")==1){
cs_set_user_model(player,"neo")
}
give_item(player,"weapon_deagle")
set_hudmessage( 0, 200, 0, -1.0, -1.0, 0, 6.0, 6.0, 0.5, 1.5, 4 )
show_hudmessage(player, "You have Entered the Matrix!")
console_print(id,"%s has entered the Matrix",name)
}
if (file_exists("sound/ambience/realworld.wav")==1){
emit_sound(player,CHAN_STATIC, "ambience/realworld.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
set_user_health(player,get_cvar_num("matrix_health"))
set_user_armor(player,get_cvar_num("matrix_armor"))
set_user_gravity(player,0.50)
set_user_maxspeed(player,550.0)
is_matrix[player] = true
is_matrix2[id] = true
}else{
console_print(id,"% is already in the Matrix",name)
}
return PLUGIN_HANDLED
}
public change_human(id,level,cid) {
if (!cmd_access(id,level,cid,1)) {
return PLUGIN_CONTINUE
}
new arg[32]
new player
read_argv(1,arg,32)
if(arg[0]) {
player = cmd_target(id,arg,0)
if(!player)
return PLUGIN_HANDLED
}
new name[32]
new admin[32]
get_user_name(player,name,31)
get_user_name(id,admin,31)
if (is_matrix[player]){
is_matrix[player] = false
is_matrix2[id] = false
cs_reset_user_model(player)
set_user_gravity(player,1.0)
set_user_maxspeed(player, 320.0)
set_hudmessage( 0, 200, 0, -1.0, -1.0, 0, 6.0, 6.0, 0.5, 1.5, 4 )
show_hudmessage(player, "You have left the Matrix")
console_print(id, "%s was taken out of the Matrix!",name)
}else{
console_print(id, "%s was never in the Matrix!",name)
}
return PLUGIN_HANDLED
}
public client_matrix(id) {
if (get_cvar_num("matrix_client")==1){
new name2[32]
new team2=get_user_team(id)
get_user_name(id,name2,31)
if (!is_matrix[id]){
if (team2 == 1){
if (file_exists("models/player/smith/smith.mdl")==1){
cs_set_user_model(id,"smith")
}
set_hudmessage( 0, 200, 0, -1.0, -1.0, 0, 6.0, 6.0, 0.5, 1.5, 4 )
show_hudmessage(id, "You have Entered the Matrix!")
client_print(id,print_chat,"[Matrix] You have Entered the Matrix")
}else if (team2 == 2){
if (file_exists("models/player/neo/neo.mdl")==1){
cs_set_user_model(id,"neo")
}
set_hudmessage( 0, 200, 0, -1.0, -1.0, 0, 6.0, 6.0, 0.5, 1.5, 4 )
show_hudmessage(id, "You have Entered the Matrix!")
client_print(id,print_chat,"[Matrix] You have Entered the Matrix")
}
if (file_exists("sound/ambience/realworld.wav")==1){
emit_sound(id,CHAN_STATIC, "ambience/realworld.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
set_user_health(id,get_cvar_num("matrix_health"))
set_user_armor(id,get_cvar_num("matrix_armor"))
set_user_gravity(id,0.50)
give_item(id,"weapon_deagle")
set_user_maxspeed(id,550.0)
is_matrix2[id] = true
}else if (is_matrix[id]){
client_print(id,print_chat,"[Matrix] You are already in the Matrix")
}
}else if (get_cvar_num("matrix_client")==0){
client_print(id,print_chat,"[Matrix] The Admin has Disabled it so Clients can NOT Enter the Matrix Manually")
}
return PLUGIN_HANDLED
}
public client_human(id) {
if (get_cvar_num("matrix_client")==1){
new name2[32]
get_user_name(id,name2,31)
if (is_matrix[id]){
cs_reset_user_model(id)
set_hudmessage( 0, 200, 0, -1.0, -1.0, 0, 6.0, 6.0, 0.5, 1.5, 4 )
show_hudmessage(id, "You have Exited the Matrix!")
client_print(id,print_chat,"[Matrix] You have Exited the Matrix")
set_user_gravity(id,1.0)
set_user_maxspeed(id,320.0)
is_matrix2[id] = false
}else if (!is_matrix[id]){
client_print(id,print_chat,"[Matrix] You were never in the Matrix")
}
}else if (get_cvar_num("matrix_client")==0){
client_print(id,print_chat,"[Matrix] The Admin has Disabled it so Clients can NOT Leave the Matrix Manually")
}
return PLUGIN_HANDLED
}
public weapon(){
new id = read_data (1)
if (is_matrix[id]) {
set_user_maxspeed(id,550.0)
new clip, ammo
new weapon_id=get_user_weapon(id,clip,ammo)
new weapon2[32]
if ( weapon_id!=CSW_DEAGLE ) return PLUGIN_CONTINUE
if ( clip < 2){
get_weaponname(weapon_id,weapon2,31)
give_item(id, weapon2)
client_cmd(id, weapon2)
client_cmd(id, weapon2) //checking if multi sends helps
client_cmd(id, weapon2) //checking if multi sends helps
}
}
return PLUGIN_CONTINUE
}
public round_reset(id){
new team=get_user_team(id)
if (is_matrix2[id]) {
if (team == 1){
if (file_exists("models/player/smith/smith.mdl")==1){
cs_set_user_model(id,"smith")
}
set_user_health(id,get_cvar_num("matrix_health"))
set_user_armor(id,get_cvar_num("matrix_armor"))
set_user_gravity(id,0.50)
set_user_maxspeed(id,550.0)
}else if(team == 2){
if (file_exists("models/player/neo/neo.mdl")==1){
cs_set_user_model(id,"neo")
}
set_user_health(id,get_cvar_num("matrix_health"))
set_user_armor(id,get_cvar_num("matrix_armor"))
set_user_gravity(id,0.50)
set_user_maxspeed(id,550.0)
}
}
return PLUGIN_CONTINUE
}
public plugin_init() {
register_plugin("Enter the Matrix","1.92","Burnzy")
register_concmd("amx_matrix","change_matrix",ADMIN_LEVEL_A,"<nick|authid|#userid>")
register_concmd("amx_unmatrix","change_human",ADMIN_LEVEL_A,"<nick|authid|#userid>")
register_clcmd("/matrix","client_matrix",0,"Clients Enter Matrix Manually")
register_clcmd("/unmatrix","client_human",0,"Clients Leave Matrix Manually")
register_cvar("matrix_client","0") //Allows Clients to Enter Matrix if 1
register_cvar("matrix_armor","200") //Changes Armor of Matrix Players
register_cvar("matrix_health","200") //Changes Health of Matrix Players
register_event("CurWeapon","weapon","be","1=1")
register_event("ResetHUD","round_reset","b")
set_task(1.0,"check_cvars",0,"",0,"b")
return PLUGIN_CONTINUE
}
public plugin_precache() {
if (file_exists("sound/ambience/realworld.wav")==1)
precache_sound("ambience/realworld.wav")
if (file_exists("models/player/smith/smith.mdl")==1)
precache_model("models/player/smith/smith.mdl")
if (file_exists("models/player/neo/neo.mdl")==1)
precache_model("models/player/neo/neo.mdl")
return PLUGIN_CONTINUE
}
public check_cvars() {
if (get_cvar_num("matrix_health") > 300) {
server_print("[Matrix] matrix_health can not be greater than 300, setting cvar to 300 now.")
set_cvar_num("matrix_health", 300)
}
if (get_cvar_num("matrix_health") < 100) {
server_print("[Matrix] matrix_health can not be less than 100, setting cvar to 100 now.")
set_cvar_num("matrix_health", 100)
}
if (get_cvar_num("matrix_armor") > 300) {
server_print("[Matrix] matrix_armor can not be greater than 300, setting cvar to 300 now.")
set_cvar_num("matrix_armor", 300)
}
if (get_cvar_num("matrix_armor") < 100) {
server_print("[Matrix] matrix_armor can not be less than 100, setting cvar to 100 now.")
set_cvar_num("matrix_armor", 100)
}
}