Raised This Month: $ Target: $400
 0% 

devil where are you? come help me again


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Poison_Jay
Senior Member
Join Date: May 2004
Old 06-23-2004 , 21:45   devil where are you? come help me again
Reply With Quote #1

Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
    register_plugin("Shield War","1","Poison_Jay"); 
    register_event("CurWeapon","shield","be","1=1")
    register_cvar("amx_shieldwar","1");
    return PLUGIN_CONTINUE;
}

public shield(id) { 
	if(get_cvar_num("amx_shieldwar")==0)
		return PLUGIN_CONTINUE 
		public shield(id) { 
	if(get_cvar_num("amx_shieldwar")==1)
give_item(id,"weapon_shield")  
give_item(id,"weapon_deagle")
		give_item(id,"ammo_50ae")
		give_item(id,"ammo_50ae")
		give_item(id,"ammo_50ae")
		give_item(id,"ammo_50ae")
		give_item(id,"ammo_50ae")
		
}
This what i got when compiling....
Quote:
/home/users/amxmodx/tmp/phpZs98RB.sma(15) : warning 217: loose indentation
/home/users/amxmodx/tmp/phpZs98RB.sma(15) : error 029: invalid expression, assumed zero
/home/users/amxmodx/tmp/phpZs98RB.sma(15) : error 001: expected token: ";", but found "{"
/home/users/amxmodx/tmp/phpZs98RB.sma(17) : error 017: undefined symbol "give_item"
/home/users/amxmodx/tmp/phpZs98RB.sma(1 : warning 217: loose indentation
/home/users/amxmodx/tmp/phpZs98RB.sma(1 : error 017: undefined symbol "give_item"
/home/users/amxmodx/tmp/phpZs98RB.sma(19) : warning 217: loose indentation
/home/users/amxmodx/tmp/phpZs98RB.sma(19) : error 017: undefined symbol "give_item"
/home/users/amxmodx/tmp/phpZs98RB.sma(20) : error 017: undefined symbol "give_item"
/home/users/amxmodx/tmp/phpZs98RB.sma(21) : error 017: undefined symbol "give_item"
/home/users/amxmodx/tmp/phpZs98RB.sma(22) : error 017: undefined symbol "give_item"
/home/users/amxmodx/tmp/phpZs98RB.sma(23) : error 017: undefined symbol "give_item"
/home/users/amxmodx/tmp/phpZs98RB.sma(25) : error 001: expected token: "}", but found "-end of file-"

10 Errors.
Poison_Jay is offline
Send a message via MSN to Poison_Jay
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-23-2004 , 22:00  
Reply With Quote #2

post code
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Poison_Jay
Senior Member
Join Date: May 2004
Old 06-23-2004 , 22:20  
Reply With Quote #3

done, maybe u can also help me, my "frist time ever doing this" plugin seems abit...empty
Poison_Jay is offline
Send a message via MSN to Poison_Jay
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-23-2004 , 22:27  
Reply With Quote #4

First, plugin_init doesnt return a value
Second, stop using notepad, and start using actual tabs instead of spaces
Third, if statements need {} unless you just want to execute the next line
Fourth, give_item is in fun, so fun needs to be included, amxmisc isnt used so it doesnt need to be included
Fifth, use [ small] [ /small] when posting plugins
I fixed the code

Code:
#include <amxmodx> #include <fun> public plugin_init() {     register_plugin("Shield War","1","Poison_Jay");     register_event("CurWeapon","shield","be","1=1")     register_cvar("amx_shieldwar","1"); } public shield(id) {     if(get_cvar_num("amx_shieldwar")==0)         return PLUGIN_CONTINUE             if(get_cvar_num("amx_shieldwar")==1) {         give_item(id,"weapon_shield")         give_item(id,"weapon_deagle")         give_item(id,"ammo_50ae")         give_item(id,"ammo_50ae")         give_item(id,"ammo_50ae")         give_item(id,"ammo_50ae")         give_item(id,"ammo_50ae")     }     return PLUGIN_HANDLED }
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Poison_Jay
Senior Member
Join Date: May 2004
Old 06-23-2004 , 22:30  
Reply With Quote #5

so that will work?

Code:
public shield(id) {     if(get_cvar_num("amx_shieldwar")==0)            return PLUGIN_CONTINUE                 if(get_cvar_num("amx_shieldwar")==1) {         give_item(id,"weapon_shield")         give_item(id,"weapon_deagle")         give_item(id,"ammo_50ae")         give_item(id,"ammo_50ae")         give_item(id,"ammo_50ae")         give_item(id,"ammo_50ae")         give_item(id,"ammo_50ae")

so if i amx_shieldwar 1, will everyone get a shield and deagle? looks like only the person -.-

and how to make it keep doing it every round

oh ya, i using JK editor
Poison_Jay is offline
Send a message via MSN to Poison_Jay
Mugwump
Senior Member
Join Date: May 2004
Old 06-24-2004 , 11:06  
Reply With Quote #6

There is an event you could map for new_rounds in your plugin_init so that you could supply that stuff every round. Something like this:

Code:
// Calls new_round at the start of each new round, put in plugin_init()
register_event("ResetHUD", "new_round", "b")
Then make a new_round function and add the code you had, but make it so everyone gets the stuff:

Code:
public new_round(id){
   new players[32], numofplayers

   get_players(players, numofplayers)

   // Iterate through all players and give shield and ammo
   for (new i=0; i<numofplayers; i++){  
      if (get_cvar_num("amx_shieldwar")==1) {
         new pid = players[i]
         give_item(pid, "weapon_shield")
         give_item(pid, "weapon_deagle")
         give_item(pid, "ammo_50ae")
         give_item(pid, "ammo_50ae")
         give_item(pid, "ammo_50ae")
         give_item(pid, "ammo_50ae")
         give_item(pid, "ammo_50ae")
      }
   }

   return PLUGIN_CONTINUE
}
Mugwump is offline
Poison_Jay
Senior Member
Join Date: May 2004
Old 06-24-2004 , 11:28  
Reply With Quote #7

Code:
/* AMXX Mod script. * * Shield War * Version Beta 1 * By: Poison_Jay * Special Thanks: Peli, Kingpin * * MSN: <a href="mailto:[email protected]">[email protected]</a> * * Commands: amx_shieldwar 1|0 * * Discription: All Players Spawn With Shield + Deagle */ #define TIME 5.0 #include <amxmodx> #include <fun> public plugin_init() {     register_plugin("Shield War","1","Poison_Jay");     register_event("CurWeapon","shield","be","1=1")     register_cvar("amx_shieldwar","1")     register_concmd("amx_shieldwar","amx_shieldwar",ADMIN_LEVEL_B,"1 = On 2 = Off") } public shield(id) {     if(get_cvar_num("amx_shieldwar")==0)            return PLUGIN_CONTINUE                     if(get_cvar_num("amx_shieldwar")==1) {         set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, TIME, 0.5, 1.5, 4 )         show_hudmessage(0, "ShieldWar mode has been enabled")         new clip, ammo         new usersweapon = get_user_weapon(id,clip,ammo)         client_cmd(id, "drop")         if(usersweapon==CSW_DEAGLE) {             give_item(id,"ammo_50ae")         } else {             set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, TIME, 0.5, 1.5, 4 )             show_hudmessage(0,"ShieldWar mode has been enabled")             give_item(id,"weapon_shield")             give_item(id,"weapon_deagle")             give_item(id,"ammo_50ae")             give_item(id,"ammo_50ae")             give_item(id,"ammo_50ae")             give_item(id,"ammo_50ae")             give_item(id,"ammo_50ae")             set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, TIME, 0.5, 1.5, 4 )             show_hudmessage(0, "ShieldWar mode has been enabled")         }     }     return PLUGIN_HANDLED

here's the one asskickr helped me edit, where do i put?
Poison_Jay is offline
Send a message via MSN to Poison_Jay
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 06-24-2004 , 19:46  
Reply With Quote #8

I think this would be it , but I'm kinda new to scripting too :
Code:
/* AMXX Mod script. * * Shield War * Version Beta 1 * By: Poison_Jay * Special Thanks: Peli, Kingpin * * MSN: <a href="mailto:[email protected]">[email protected]</a> * * Commands: amx_shieldwar 1|0 * * Discription: All Players Spawn With Shield + Deagle */ #define TIME 5.0 #include <amxmodx> #include <fun> public plugin_init() {     register_plugin("Shield War","1","Poison_Jay");     register_event("CurWeapon","shield","be","1=1")     register_event("ResetHUD", "new_round", "b")     register_cvar("amx_shieldwar","1")     register_concmd("amx_shieldwar","amx_shieldwar",ADMIN_LEVEL_B,"1 = On 2 = Off") } public shield(id) {     if(get_cvar_num("amx_shieldwar")==0)            return PLUGIN_CONTINUE public new_round(id){    new players[32], numofplayers    get_players(players, numofplayers)    for (new i=0; i<numofplayers; i++){         if (get_cvar_num("amx_shieldwar")==1) {          new pid = players[i]          give_item(pid, "weapon_shield")          give_item(pid, "weapon_deagle")          give_item(pid, "ammo_50ae")          give_item(pid, "ammo_50ae")          give_item(pid, "ammo_50ae")          give_item(pid, "ammo_50ae")          give_item(pid, "ammo_50ae")          set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, TIME, 0.5, 1.5, 4 )          show_hudmessage(0, "ShieldWar mode has been enabled")      }    }    return PLUGIN_CONTINUE }
Peli is offline
Send a message via MSN to Peli
Poison_Jay
Senior Member
Join Date: May 2004
Old 06-24-2004 , 23:10  
Reply With Quote #9

nope

it got errors

/home/users/amxmodx/tmp/iFnEQvFb.sma(32) : warning 217: loose indentation
/home/users/amxmodx/tmp/iFnEQvFb.sma(32) : error 029: invalid expression, assumed zero
/home/users/amxmodx/tmp/iFnEQvFb.sma(32) : error 017: undefined symbol "new_round"
/home/users/amxmodx/tmp/iFnEQvFb.sma(52) : error 001: expected token: "}", but found "-end of file-"

3 Errors.
Poison_Jay is offline
Send a message via MSN to Poison_Jay
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 14:47.


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