Raised This Month: $51 Target: $400
 12% 

no-snap (why they don't work)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Parchatek
Junior Member
Join Date: Feb 2007
Location: In Breslau
Old 02-01-2007 , 08:27   no-snap (why they don't work)
Reply With Quote #1

Hello, it's my first plugins and i don't know why they don't work.
Quote:

#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN "no-snap"
#define VERSION "1.0"
#define AUTHOR "Parchatek-b.pasz"


public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("WeapPickup", "pod_bron", "be")
// Add your code here...
}
public pod_bron() {
//new gracze[32]
new i=1
new id_bron
new a,b
while (i++ <=32)
{
id_bron=get_user_weapon (i,a,b)
if (id_bron==CSW_AWP || id_bron==CSW_SCOUT) {
strip_user_weapons(i)
client_print(i,print_chat,"wywal ta snajpere")
}



}


return PLUGIN_HANDLED
}
Parchatek is offline
Send a message via Skype™ to Parchatek
bahr
Member
Join Date: Aug 2005
Old 02-01-2007 , 08:48   Re: no-snap (why they don't work)
Reply With Quote #2

Try doing strip weapons 2 times:

...
strip_user_weapons(i)
strip_user_weapons(i)
...

In my plugins, I had to do that twice for it to work...
bahr is offline
Send a message via MSN to bahr
Parchatek
Junior Member
Join Date: Feb 2007
Location: In Breslau
Old 02-01-2007 , 09:12   no-snap (why they don't work)
Reply With Quote #3

I did this and i looked into console of server and i saw this:
Quote:
L 02/01/2007 - 14:22:55: Invalid player id 8
L 02/01/2007 - 14:22:55: [AMXX] Displaying debug trace (plugin "bez_snajpery.amxx")
L 02/01/2007 - 14:22:55: [AMXX] Run time error 10: native error (native "get_user_weapon")
L 02/01/2007 - 14:22:55: [AMXX] [0] bez_snajpery.sma::pod_bron (line 24)
I didn't see any efects in game.
Parchatek is offline
Send a message via Skype™ to Parchatek
bahr
Member
Join Date: Aug 2005
Old 02-01-2007 , 13:10   Re: no-snap (why they don't work)
Reply With Quote #4

Code:
public pod_bron(id) {
    new id_bron
    new a,b
    id_bron=get_user_weapon (id,a,b)
    if (id_bron==CSW_AWP || id_bron==CSW_SCOUT) {
        strip_user_weapons(id)
        strip_user_weapons(id)
        client_print(id,print_chat,"wywal ta snajpere") 
    }
}

Last edited by bahr; 02-01-2007 at 17:07.
bahr is offline
Send a message via MSN to bahr
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 02-01-2007 , 15:32   Re: no-snap (why they don't work)
Reply With Quote #5

bahr stop.

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define PLUGIN "no-snap" #define VERSION "1.0" #define AUTHOR "Parchatek-b.pasz" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("WeapPickup", "pod_bron", "be") } public pod_bron() {     //new gracze[32]     new i     new id_bron     new a,b     for (i = 0; i < 33; i++)     {         if (is_user_connected(i))         {             id_bron = get_user_weapon (i,a,b)             if (id_bron == CSW_AWP || id_bron == CSW_SCOUT)             {                 strip_user_weapons(i)                 client_print(i,print_chat,"wywal ta snajpere")             }         }         }     return PLUGIN_HANDLED }
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
Parchatek
Junior Member
Join Date: Feb 2007
Location: In Breslau
Old 02-01-2007 , 16:35   Re: no-snap (why they don't work)
Reply With Quote #6

Hello,
I did try this. Script compiled and worked witouts error but I don't see effects (i can take and run with awm). i realy don't understand.

Edit:
I tested this script and i think it samethings wrong with this:
Quote:
id_bron = get_user_weapon (i,a,b)
if (id_bron == CSW_AWP || id_bron == CSW_SCOUT)

Last edited by Parchatek; 02-01-2007 at 16:54.
Parchatek is offline
Send a message via Skype™ to Parchatek
bahr
Member
Join Date: Aug 2005
Old 02-01-2007 , 16:55   Re: no-snap (why they don't work)
Reply With Quote #7

Did you tried my code?
bahr is offline
Send a message via MSN to bahr
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 02-01-2007 , 17:07   Re: no-snap (why they don't work)
Reply With Quote #8

Quote:
Originally Posted by bahr View Post
Did you tried my code?
Your code will still give the error PLUS there is no need to do use strip_user_weapons() twice
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
bahr
Member
Join Date: Aug 2005
Old 02-01-2007 , 17:08   Re: no-snap (why they don't work)
Reply With Quote #9

Stop talking shit P34nut
You don't even know what your talking about.

1. public pod_bron() must be public pod_bron(id)
Thus,
2. No need to scan for all players

Last edited by bahr; 02-01-2007 at 17:11.
bahr is offline
Send a message via MSN to bahr
Parchatek
Junior Member
Join Date: Feb 2007
Location: In Breslau
Old 02-01-2007 , 17:21   Re: no-snap (why they don't work)
Reply With Quote #10

I tried all codes in this page but anything worked.

Edit:
Quote:
#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN "no-snap"
#define VERSION "1.0"
#define AUTHOR "Parchatek-b.pasz"


public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("WeapPickup", "pod_bron", "be")
}
public pod_bron()
{
//new gracze[32]
new i
new id_bron
new a,b
for (i = 0; i < 33; i++)
{
if (is_user_connected(i))
{
id_bron = get_user_weapon (i,a,b)
if ((id_bron == CSW_AWP) || (id_bron == CSW_SCOUT))
{
strip_user_weapons(i)
client_print(i,print_chat,"wywal ta snajpere")
}
}

}
return PLUGIN_HANDLED
}


If is doing ONLY (if ((id_bron == CSW_AWP) || (id_bron == CSW_SCOUT))) when map start (i have only knife and pistol) and never after . Why?

Last edited by Parchatek; 02-01-2007 at 17:57.
Parchatek is offline
Send a message via Skype™ to Parchatek
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 16:14.


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