Raised This Month: $ Target: $400
 0% 

first time plz help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
warchild690
Junior Member
Join Date: Mar 2006
Old 03-06-2006 , 20:39   first time plz help
Reply With Quote #1

ok im trying to write a pistols only mod, similar to knifes only, it is mostly writen from scratch but i borrowed bits-n-peices from a knifes only mod,

i have bunches of errors that i have no idea how to fix


Welcome to the AMX Mod X 1.70-300 Compiler.
Copyright (c) 1997-2005 ITB CompuPhase, AMX Mod X Team

/home/users/amxmodx/tmp3/phpExvPVA.sma(2) : error 029: invalid expression, assumed zero
/home/users/amxmodx/tmp3/phpExvPVA.sma(2 -- 4) : warning 215: expression has no effect
/home/users/amxmodx/tmp3/phpExvPVA.sma(4) : error 010: invalid function or declaration
/home/users/amxmodx/tmp3/phpExvPVA.sma(8 -- 9) : error 029: invalid expression, assumed zero
/home/users/amxmodx/tmp3/phpExvPVA.sma(10) : error 010: invalid function or declaration
/home/users/amxmodx/tmp3/phpExvPVA.sma(14) : error 017: undefined symbol "read_argv"
/home/users/amxmodx/tmp3/phpExvPVA.sma(15) : error 017: undefined symbol "set_hudmessage"
/home/users/amxmodx/tmp3/phpExvPVA.sma(16) : error 017: undefined symbol "equal"
/home/users/amxmodx/tmp3/phpExvPVA.sma(17) : error 017: undefined symbol "usponly"
/home/users/amxmodx/tmp3/phpExvPVA.sma(17 -- 1 : warning 215: expression has no effect
/home/users/amxmodx/tmp3/phpExvPVA.sma(1 : error 017: undefined symbol "client_cmd"
/home/users/amxmodx/tmp3/phpExvPVA.sma(19) : error 017: undefined symbol "console_print"
/home/users/amxmodx/tmp3/phpExvPVA.sma(20) : error 017: undefined symbol "show_hudmessage"
/home/users/amxmodx/tmp3/phpExvPVA.sma(21) : error 017: undefined symbol "equal"
/home/users/amxmodx/tmp3/phpExvPVA.sma(22) : error 017: undefined symbol "usponly"
/home/users/amxmodx/tmp3/phpExvPVA.sma(22 -- 23) : warning 215: expression has no effect
/home/users/amxmodx/tmp3/phpExvPVA.sma(23) : error 017: undefined symbol "console_print"
/home/users/amxmodx/tmp3/phpExvPVA.sma(24) : error 017: undefined symbol "show_hudmessage"
/home/users/amxmodx/tmp3/phpExvPVA.sma(26) : error 017: undefined symbol "usponly"
/home/users/amxmodx/tmp3/phpExvPVA.sma(27) : error 017: undefined symbol "console_print"
/home/users/amxmodx/tmp3/phpExvPVA.sma(29) : error 017: undefined symbol "usponly"
/home/users/amxmodx/tmp3/phpExvPVA.sma(30) : error 017: undefined symbol "console_print"
/home/users/amxmodx/tmp3/phpExvPVA.sma(33) : warning 217: loose indentation
/home/users/amxmodx/tmp3/phpExvPVA.sma(33) : error 029: invalid expression, assumed zero
/home/users/amxmodx/tmp3/phpExvPVA.sma(33) : error 017: undefined symbol "usp"
/home/users/amxmodx/tmp3/phpExvPVA.sma(34) : warning 217: loose indentation
/home/users/amxmodx/tmp3/phpExvPVA.sma(34) : error 017: undefined symbol "usponly"
/home/users/amxmodx/tmp3/phpExvPVA.sma(37) : error 017: undefined symbol "usponly"
/home/users/amxmodx/tmp3/phpExvPVA.sma(3 : error 003: declaration of a local variable must appear in a compound block
/home/users/amxmodx/tmp3/phpExvPVA.sma(3 : warning 217: loose indentation
/home/users/amxmodx/tmp3/phpExvPVA.sma(3 : error 017: undefined symbol "clip"
/home/users/amxmodx/tmp3/phpExvPVA.sma(3 : error 017: undefined symbol "ammo"

Compilation aborted.
26 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/phpExvPVA.amx (compile failed).

those are my errors






plz help me
also, plz tell me how to fix them, dont just do for me, i need to learn

thnx bunches

sry bout having to dl it, im to retarded to figure out how to post it[/code]
Attached Files
File Type: sma Get Plugin or Get Source (pistols_only3.sma - 442 views - 1.2 KB)
warchild690 is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 03-06-2006 , 20:57  
Reply With Quote #2

Try fixing your errors one at a time, starting with the first one listed. Often, subsequent errors are a result of previous errors.

It looks like most of your errors are stemming from the same thing. Every function must be in the form of:
Code:
public myFunction(myArgs) {    // code }
Compare that to how you have your functions defined.
Brad is offline
warchild690
Junior Member
Join Date: Mar 2006
Old 03-06-2006 , 22:30  
Reply With Quote #3

thnx u, wich one to change tho, i have no idea, or wat to change them to
warchild690 is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 03-06-2006 , 22:40  
Reply With Quote #4

post your code
c0rdawg is offline
Send a message via AIM to c0rdawg Send a message via MSN to c0rdawg
warchild690
Junior Member
Join Date: Mar 2006
Old 03-06-2006 , 22:46  
Reply With Quote #5

just dl the sma file , like i said im to retarded to post it
warchild690 is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-06-2006 , 22:47  
Reply With Quote #6

he also needs
#include <amxmodx>
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
warchild690
Junior Member
Join Date: Mar 2006
Old 03-06-2006 , 23:00  
Reply With Quote #7

thnx but that didnt get rid of ne errors
warchild690 is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 03-06-2006 , 23:03  
Reply With Quote #8

This is his code for people like c0rdawg that don't seem to know how to download attached files.

Get ready to feel your eyes burn...

Code:
public plugin_init() )         register_concmd("amx_usp", "cmd_usp", ADMIN_SLAY, "@ALL") ) public cmd_usp(id, level, cid) (     if (!cmd_access(id, level, cid, 2))         return PLUGIN_HANDLED         public cmdusp_only(id){    new arg[2]    read_argv(1,arg,1)    set_hudmessage(200, 100, 0, -1.0, 0.25, 0, 1.0, 5.0, 0.1, 0.2, 2)    if(equal(arg,"1")){    usponly = 1    client_cmd(id,"weapon_usp")    console_print(id,"usp Only has been turned on.")    show_hudmessage(0,"usp Only has been turned on.")    } else if(equal(arg,"0")){    usponly = 0    console_print(id,"usp Only has been turned off.")    show_hudmessage(0,"usp Only has been turned off.")    } else {    if (usponly==0){    console_print(id,"Usage: amx_usponly 1 = 0n 0 = off Currently: OFF")    }    if (usponly==1){    console_print(id,"Usage: amx_usponly 1 = 0n 0 = off Currently: ON")     public usp(id)         if (usponly==0)             //nothing                     if (usponly==1)             new clip, ammo             new usersweapon = get_user_weapon(id, clip, ammo)             client_cmd(id, "drop")             if(usersweapon==CSW_USP)                 //nothing             if(usersweapon==CSW_FLASHBANG)                 //nothing             if(usersweapon==CSW_SMOKEGRENADE)                 //nothing                                 client_cmd(id, "weapon_usp")         )         return PLUGIN_HANDLED )

Now, in answer to your most recent question... Your first error indicated a problem with line 2. Look at your line 2.

Compare this function:
Code:
public plugin_init() ) // <--- this is line 2         register_concmd("amx_usp", "cmd_usp", ADMIN_SLAY, "@ALL") )
To this "model function":
Code:
public myFunction() {    // code }
See the differences?
Brad is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 03-06-2006 , 23:22  
Reply With Quote #9

hehe i'm sorry, I didn't notice that he posted the sma... sorry

Yeah theres alot of errors in this code
don't forget to include amxmodx and amxmisc

also make sure you close all your functions...
cmdusp_only isn't closed

also the variabled usponly is never defined...

theres probably some more errors but thats what i noticed quickly
c0rdawg is offline
Send a message via AIM to c0rdawg Send a message via MSN to c0rdawg
warchild690
Junior Member
Join Date: Mar 2006
Old 03-07-2006 , 16:42  
Reply With Quote #10

thnx u but i still cant get rid of ne of the errors, her is the updated code, i might have fucked it up more but idk...
Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
(
	//register_concmd("amx_usp", "cmd_usp", ADMIN_SLAY, "@ALL")
)

public cmd_usp(id, level, cid)
(
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED
)


public cmdusp_only(id){
   new arg[2]
   read_argv(1,arg,1)
   set_hudmessage(200, 100, 0, -1.0, 0.25, 0, 1.0, 5.0, 0.1, 0.2, 2)
   if(equal(arg,"1")){
   usponly = 1
   client_cmd(id,"weapon_usp")
   console_print(id,"usp Only has been turned on.")
   show_hudmessage(0,"usp Only has been turned on.")
   } else if(equal(arg,"0")){
   usponly = 0
   console_print(id,"usp Only has been turned off.")
   show_hudmessage(0,"usp Only has been turned off.")
   } else {
   if (usponly==0){
   console_print(id,"Usage: amx_usponly 1 = 0n 0 = off Currently: OFF")
   }else(
   if (usponly==1){
   console_print(id,"Usage: amx_usponly 1 = 0n 0 = off Currently: ON")
)
public usp(id)(
	if (usponly==0)
		//nothing
			
	if (usponly==1)
		new clip, ammo
		new usersweapon = get_user_weapon(id, clip, ammo)
		client_cmd(id, "drop")
		if(usersweapon==CSW_USP)
			//nothing
		if(usersweapon==CSW_FLASHBANG)
			//nothing
		if(usersweapon==CSW_SMOKEGRENADE)
			//nothing
				
		client_cmd(id, "weapon_usp")
	
)	
(
		return PLUGIN_HANDLED

)

yay i figured it out
warchild690 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 20:28.


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