Hello
and im back
now i have some problem in my code
PHP Code:
/* Plugin generated by Kml :O */
/*
*This plugin is a knife only mod .
*To activate it , press ~ and type ksp 1
*to disable do it vice versa as in ksp 0 .
*This plugin , when you activate it , it will remind all users that we are using this mod
*so that they wont be surprised or mad
*KSP
*Version 2.0
*Made by Tiramosu >:D
*This plugin is using VERY LESS CPU usage .
*Good for Knife only server
*if the plugin are mulfunctioning or having bug please report .
*any Ideas or suggesting are welcomed
*And dont worry this comment wont be Included in this plugin
*comments will be ignored when they are changed into amxx
*/
#include <amxmodx>
#include <fun>
// Plugin name
#define PLUGIN "KSP"
// Version now is 2.0 >:D
#define VERSION "2.0"
// Author :O
#define AUTHOR "TiraMushroom"
// Global Variable :O
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar( "ksp" , "0" )
register_event("CurWeapon","cur_weapon","be","1=1")
register_clcmd("say","handle_say")
}
// Function for the event we registered
public cur_weapon(id)
{
// This is for detecting the command . ( on or off?)
new detect = (get_cvar_num("ksp"))
// using the detect . we can use switch .
switch (detect)
{
// is the ksp is 1? if yes continue
case (1):
{
// To set where the message Place is
set_hudmessage(42, 255, 0, -1.0, -1.0, 0, 6.0, 1.8)
// To remind Some people that we are using only knife mod
show_hudmessage(0, "This server is using KNIFE ONLY MOD")
// Deleting (strip) all user weapons . So they have no weapon
// This means their weapon is gone . It disapeared instead of throwing
// since they have no weapon , we give them knife
strip_user_weapons (0);
give_item(0,"weapon_knife") ;
return PLUGIN_HANDLED
}
// if it is ksp 0 then it will go through here
case (0):
{
// when this is 0 , what do you want to do? so we just
// Stops anything from this plugin to be activated.here
// for zero
return PLUGIN_HANDLED;
}
}
// After doing all that . lets stop the plugin here .
return PLUGIN_HANDLED;
}
public handle_say(id)
{
new said[192]
read_args(said,192)
remove_quotes(said)
if( (containi(said, "knife") != -1) ) {
client_print(id, print_chat, "[KSP] This server have knife mod plugin installed")
new detect = (get_cvar_num("ksp"))
switch (detect)
{
case (1):
{
client_print(id, print_chat, "[KSP] Knife mod is on")
}
case (0):
{
client_print(id, print_chat, "[KSP] Knife mod is not enabled")
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
Problem :
When Starting the plugin in console will say
L 07/18/2009 - 11:50:43: [FUN] Player out of range (0)
L 07/18/2009 - 11:50:43: [AMXX] Run time error 10 (plugin "435345435.amxx") (native "strip_user_weapons") - debug not enabled
and also it will only show hud message and wont do the Stripping and giving and also speed .
so can any1 help me?
__________________