Raised This Month: $ Target: $400
 0% 

need your help please :D


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kristof1104
New Member
Join Date: Nov 2007
Old 11-25-2007 , 13:12   need your help please :D
Reply With Quote #1

Hy everyone, I made this script to remove every weapon and add a knife when ever I use amx_knife 1 , then I wanted to do the same when a user picks up a weapon but for some reason it just won't work

#include <amxmod>
#include <amxmisc> //This contains some useful functions
#include <fun> //This contains the function to change health
new PLUGIN[]="Knife Round"
new AUTHOR[]="Kristof"
new VERSION[]="1.00"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_Knife", "cmd_kniferound", ADMIN_SLAY, "1 or 0 ")
register_event("WeapPickup","check_wapen","b" ,"1!6")
register_cvar("sv_noweapons","0")

}

public check_wapen()
{
if (get_cvar_num("sv_noweapons") != 1)
return PLUGIN_CONTINUE

new id = read_data(0)
new name[18]
get_user_name ( id, name, 17 )
new player = find_player(name)

client_print(id, print_center, "Wapens zijn niet toegelaten.Enkel Knife!")
client_print(id, print_center,"%s",name)
strip_user_weapons (player+1)


return PLUGIN_CONTINUE
}

public cmd_kniferound(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
new a[2]//0 op einde vn string
read_argv(1,a,1)//id,output,lengte
new invoer = str_to_num(a)

if (invoer==1)//als dan alleen mes
{

new players[32],num

get_players(players, num)
new i
for(i=0;i<num;i++){
strip_user_weapons (players[i])
give_item(i+1, "weapon_knife")
}
console_print(id, "Knife round enabled" )
set_cvar_num("sv_noweapons",1)
}else{
console_print(id, "Knife round disabled" )
set_cvar_num("sv_noweapons",0)
}
return PLUGIN_CONTINUE

}
kristof1104 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-25-2007 , 14:24   Re: need your help please :D
Reply With Quote #2

This should be enough :
PHP Code:
#include <amxmod>
#include <fun> //This contains the function to give weapons

new PLUGIN[]="Knife Round"
new AUTHOR[]="Kristof"
new VERSION[]="1.00"

new sv_noweapons

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("CurWeapon","eCurWeapon","be" ,"1=1""2!29")
    
sv_noweapons register_cvar("sv_noweapons""0")
}

public 
eCurWeapon(id) {
    if(!
get_pcvar_num(sv_noweapons))
        return

    if(!
user_has_weapon(idCSW_KNIFE))
        
give_item(id"weapon_knife")

    
client_print(idprint_center"Wapens zijn niet toegelaten.Enkel Knife!")

    
engclient_cmd(id"weapon_knife")

ConnorMcLeod is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode