Raised This Month: $ Target: $400
 0% 

[prob solved] - PLUGIN: SNIPERMODE (tested on CS:CZ)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Noizza
Senior Member
Join Date: Apr 2004
Location: Vienna (PROUD)
Old 07-11-2005 , 23:34   [prob solved] - PLUGIN: SNIPERMODE (tested on CS:CZ)
Reply With Quote #1

So... i made this plugin for my server...
should change usermoney every round start to 0 (that they cant buy) and give a few weapons to them...

Code:
#include <amxmodx>
#include <engine>
#include <fun>
#include <cstrike>

public plugin_init() {
	register_plugin("AWPandDG","0.1","Noizza")
	register_cvar("snipermode","0")
	register_logevent("roundstart",2,"0=World triggered","1=Round_Start")
}

public roundstart() {
	new mode
	mode = get_cvar_num("snipermode")
	
	if(mode = 0) {
		return PLUGIN_HANDLED
	}
	
	if(mode = 1) {
		return getwp()
	}
}


public getwp(id) {
	cs_set_user_money(id, 0, 1)
	give_item(id,"weapon_scout")
	give_item(id,"weapon_awp")
	give_item(id,"weapon_deagle")
	give_item(id,"weapon_usp")
	give_item(id,"weapon_hegrenade")
	give_item(id,"weapon_flashbang")
	
}
but doesnt work... could somebody tell me why plz?
__________________
Quote:
Originally Posted by Johnny got his gun
Read the plugin posting rules. They apply to everyone, including you.
kk...
#include <noizza>
lol

try my Server!
193.53.80.122:27016 Super-Fun Server [SHmod+DM]
Noizza is offline
Send a message via ICQ to Noizza
VanillA Ice
Senior Member
Join Date: Apr 2005
Old 07-11-2005 , 23:35  
Reply With Quote #2

Compile it and test it....
__________________
I can no longer help here......school has started... :/ goodbye everybody :'(
VanillA Ice is offline
Send a message via MSN to VanillA Ice Send a message via Yahoo to VanillA Ice
Noizza
Senior Member
Join Date: Apr 2004
Location: Vienna (PROUD)
Old 07-11-2005 , 23:36  
Reply With Quote #3

???

what you dont understand?

it doesnt work^^

just a few warnings...
but doesnt work ingame...
__________________
Quote:
Originally Posted by Johnny got his gun
Read the plugin posting rules. They apply to everyone, including you.
kk...
#include <noizza>
lol

try my Server!
193.53.80.122:27016 Super-Fun Server [SHmod+DM]
Noizza is offline
Send a message via ICQ to Noizza
VanillA Ice
Senior Member
Join Date: Apr 2005
Old 07-11-2005 , 23:42  
Reply With Quote #4

hmmm let me study the code.....
__________________
I can no longer help here......school has started... :/ goodbye everybody :'(
VanillA Ice is offline
Send a message via MSN to VanillA Ice Send a message via Yahoo to VanillA Ice
VanillA Ice
Senior Member
Join Date: Apr 2005
Old 07-11-2005 , 23:43  
Reply With Quote #5

Okay you need to target the players with a function look in funcwiki.....i am having trouble with my own plugins right now^^
__________________
I can no longer help here......school has started... :/ goodbye everybody :'(
VanillA Ice is offline
Send a message via MSN to VanillA Ice Send a message via Yahoo to VanillA Ice
Noizza
Senior Member
Join Date: Apr 2004
Location: Vienna (PROUD)
Old 07-12-2005 , 00:02  
Reply With Quote #6

kk did it myself...
thanks for the help ;)

made it like this:

Code:
#include <amxmodx>
#include <engine>
#include <fun>
#include <cstrike>

public plugin_init() {
	register_plugin("AWPandDG","0.1","Noizza")
	register_cvar("snipermode","0")
	register_logevent("roundstart",2,"0=World triggered","1=Round_Start")
}

public roundstart() {
	for(new id = 1; id < 33; id++) {
		new mode
		mode = get_cvar_num("snipermode")
		
		if(mode = 0) {
			return PLUGIN_HANDLED
		}
		
		if(mode = 1) {
			
			cs_set_user_money(id, 0, 1)
			give_item(id,"weapon_scout")
			give_item(id,"weapon_awp")
			give_item(id,"weapon_deagle")
			give_item(id,"weapon_usp")
			give_item(id,"weapon_hegrenade")
			give_item(id,"weapon_flashbang")
			
		}
		
	}
}

but now i have another problem...
it works everytime...
but should only work if cvar snipermode = 1

and by the way: where i can find the right ammo for the weapons?
__________________
Quote:
Originally Posted by Johnny got his gun
Read the plugin posting rules. They apply to everyone, including you.
kk...
#include <noizza>
lol

try my Server!
193.53.80.122:27016 Super-Fun Server [SHmod+DM]
Noizza is offline
Send a message via ICQ to Noizza
Platnum
Member
Join Date: May 2005
Old 07-12-2005 , 00:11  
Reply With Quote #7

Get rid of all the stuff you have with mode and just add:

if (!get_cvar_num("snipermode"))
return PLUGIN_HANDLED;

to the top of your roundstart() function
Platnum is offline
Noizza
Senior Member
Join Date: Apr 2004
Location: Vienna (PROUD)
Old 07-12-2005 , 00:27  
Reply With Quote #8

now it works ;)

thx a lot...

but in debug mode it say lots of stuff...
Code:
L 07/12/2005 - 06:26:12: [CSTRIKE] Invalid player 18
L 07/12/2005 - 06:26:12: [AMXX] Native error in "give_item" on line 20 (file "snipermode.sma").
L 07/12/2005 - 06:26:12: [Fun] Invalid player 18
L 07/12/2005 - 06:26:12: [AMXX] Native error in "give_item" on line 21 (file "snipermode.sma").
L 07/12/2005 - 06:26:12: [Fun] Invalid player 18
L 07/12/2005 - 06:26:12: [AMXX] Native error in "give_item" on line 22 (file "snipermode.sma").
L 07/12/2005 - 06:26:12: [Fun] Invalid player 18
L 07/12/2005 - 06:26:12: [AMXX] Native error in "give_item" on line 23 (file "snipermode.sma").
L 07/12/2005 - 06:26:12: [Fun] Invalid player 18
L 07/12/2005 - 06:26:12: [AMXX] Native error in "give_item" on line 24 (file "snipermode.sma").
L 07/12/2005 - 06:26:12: [Fun] Invalid player 18
L 07/12/2005 - 06:26:12: [AMXX] Native error in "give_item" on line 25 (file "snipermode.sma").
L 07/12/2005 - 06:26:12: [Fun] Invalid player 18
L 07/12/2005 - 06:26:12: [AMXX] Native error in "cs_set_user_money" on line 19 (file "snipermode.sma").
from players 2-18....
ans same things with players 18-32
[CSTRIKE] player out of range 18

why this error comes seems clear to me...
but how can i fix it?? ^^
__________________
Quote:
Originally Posted by Johnny got his gun
Read the plugin posting rules. They apply to everyone, including you.
kk...
#include <noizza>
lol

try my Server!
193.53.80.122:27016 Super-Fun Server [SHmod+DM]
Noizza is offline
Send a message via ICQ to Noizza
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 07-12-2005 , 00:40  
Reply With Quote #9

Code:
#include <amxmodx> #include <engine> #include <fun> #include <cstrike> public plugin_init() {     register_plugin("AWPandDG","0.1","Noizza")     register_cvar("snipermode","0")     register_logevent("roundstart",2,"0=World triggered","1=Round_Start") } public roundstart() {     for(new id = 1; id <= get_maxplayers(); id++)     {         new mode = get_cvar_num("snipermode")         new is_connected = is_user_connected(id)         new is_alive = is_user_alive(id)             if(mode)         {             if( !(is_connected) || !(is_alive) ) continue             cs_set_user_money(id, 0, 1)             give_item(id,"weapon_scout")             give_item(id,"weapon_awp")             give_item(id,"weapon_deagle")             give_item(id,"weapon_usp")             give_item(id,"weapon_hegrenade")             give_item(id,"weapon_flashbang")         }     }     return PLUGIN_CONTINUE }
Try that instead.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Noizza
Senior Member
Join Date: Apr 2004
Location: Vienna (PROUD)
Old 07-12-2005 , 00:49  
Reply With Quote #10

as a saw that v3x has replied to my problem i knew that my plugin now will run perfect ;)
and it does... thx a lot ;)

could someone plz tell me the consts for the ammos?
__________________
Quote:
Originally Posted by Johnny got his gun
Read the plugin posting rules. They apply to everyone, including you.
kk...
#include <noizza>
lol

try my Server!
193.53.80.122:27016 Super-Fun Server [SHmod+DM]
Noizza is offline
Send a message via ICQ to Noizza
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 18:04.


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