Raised This Month: $ Target: $400
 0% 

Help me please, I am newbie in script


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
detonax
Junior Member
Join Date: May 2011
Old 12-30-2012 , 12:04   Help me please, I am newbie in script
Reply With Quote #1

I "created a plugin" copying a few lines and certain other functions. the plugin is already running, so that's just a mistake. when you swap weapons or restarts the round back to the default skin. when you type the / knife, then not to select any of the following knives.
Which wanted someone correct the plugin for me.

Thank you.


Quote:
#include <amxmisc>
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <engine>
#include <nvault>
#include <vault>

#define PLUGIN "TGBR FACA"
#define VERSION "1.0"
#define AUTHOR "DetonaX"

new const TAG_CLAN[] = "TGBR"
new knife_model[33];

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

register_clcmd ("say /knife" , "knife123");
register_clcmd ("say /faca" , "knife123");
register_clcmd ("say /skin" , "knife123");
register_concmd ("knifenomenu" , "knife123")
}


public knife123(id)
{
static Item[64]

formatex(Item, charsmax(Item),"\r[ %s ] \yEscolha Sua Faca :", TAG_CLAN)
new sub = menu_create(Item, "knifemenu")

formatex(Item, charsmax(Item),"\wFaca \yDarthMaul")
menu_additem(sub, Item, "1")

formatex(Item, charsmax(Item),"\wFaca \yKatana")
menu_additem(sub, Item, "2")

formatex(Item, charsmax(Item),"\wFaca \yWolverine")
menu_additem(sub, Item, "3")

menu_display(id, sub)
}

public knifemenu(id, key) {
switch(key)
{
case 0: SetKnife(id , 0);
case 1: SetKnife(id , 1);
case 2: SetKnife(id , 2);
case 3: SetKnife(id , 3);
// case 4: SetKnife(id , 4);
// case 5: SetKnife(id , 5);
// case 6: SetKnife(id , 6);
// case 8: knifemodmenu(id);
default: return PLUGIN_HANDLED;
}
SaveKnife(id);
return PLUGIN_HANDLED;
}

public plugin_precache()
{
precache_model("models/tgbr/darthmaul_knife.mdl");
precache_model("models/tgbr/darthmaul_p_knife.mdl");
precache_model("models/tgbr/v_katana.mdl");
precache_model("models/tgbr/p_katana.mdl");
precache_model("models/tgbr/v_knife_wolf.mdl");

}


public SetKnife(id , Knife) {
knife_model[id] = Knife;

new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo);
if ( Weapon != CSW_KNIFE )
return PLUGIN_HANDLED;

new vModel[56],pModel[56];

switch(Knife)
{
case 0: {
format(vModel,55,"models/v_knife.mdl");
format(pModel,55,"models/p_knife.mdl");
}
case 1: {
format(vModel,55,"models/tgbr/darthmaul_knife.mdl");
format(pModel,55,"models/tgbr/darthmaul_p_knife.mdl");
}
case 2: {
format(vModel,55,"models/tgbr/v_katana.mdl");
format(vModel,55,"models/tgbr/v_katana.mdl");
}
case 3: {
format(vModel,55,"models/tgbr/v_knife_wolf.mdl");
}
// case 4: {
// format(vModel,55,"models/tgbr/darthmaul_knife.mdl");
// format(pModel,55,"models/tgbr/darthmaul_p_knife.mdl");
// }
// case 5: {
// format(vModel,55,"models/tgbr/v_supercut.mdl");
// format(pModel,55,"models/tgbr/p_supercut.mdl");
// }
// case 6: {
// format(vModel,55,"models/tgbr/v_katana.mdl");
// format(vModel,55,"models/tgbr/v_katana.mdl");
// }
}

entity_set_string(id, EV_SZ_viewmodel, vModel);
entity_set_string(id, EV_SZ_weaponmodel, pModel);

return PLUGIN_HANDLED;
}

public SaveKnife(id)
{
new authid[32];
get_user_authid(id, authid, 31);

new vaultkey[64];
new vaultdata[64];

format(vaultkey, 63, "KMOD_%s", authid);
format(vaultdata, 63, "%d", knife_model[id]);
set_vaultdata(vaultkey, vaultdata);
}
Attached Files
File Type: sma Get Plugin or Get Source (faca.sma - 429 views - 3.4 KB)
detonax is offline
Old 12-30-2012, 12:05
lolxxx
This message has been deleted by YamiKaitou. Reason: https://forums.alliedmods.net/misc.php?do=showrules
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-02-2013 , 15:12   Re: Help me please, I am newbie in script
Reply With Quote #2

are you sure that the menu handler is called at full and correctly?

http://forums.alliedmods.net/showthread.php?t=46364
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT

Last edited by AngeIII; 01-02-2013 at 15:14.
AngeIII is offline
Send a message via Skype™ to AngeIII
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 01-02-2013 , 15:17   Re: Help me please, I am newbie in script
Reply With Quote #3

You don't know how to use CurWeapon currectlly.
__________________
simanovich 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 13:43.


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