AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problems with my battlesuit plugin (https://forums.alliedmods.net/showthread.php?t=114215)

r4ndomz 01-02-2010 18:19

Problems with my battlesuit plugin
 
I have no clue what went wrong in the compile and i dont know how to fix the errors. Please help!

PHP Code:

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

register_plugin(Battlesuit,r4nDoMz,1.0);

new 
health get_user_health()
new 
armor get_user_armor()
//new maxspeed = get_user_maxspeed()

public plugin_init()

public 
client_putinserver()
{
    if( 
is_user_alive() ){
        
//set_user_gravity (id, 0.625)
        
cs_set_user_armor(idarmor 50)
        
cs_set_user_health(idhealth*1.5)
        
//cs_set_user_maxspeed(id, maxspeed + 100)
    
}


Errors:

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


PHP Code:

//// battlesuit.sma
// C:\Documents and Settings\*****\Desktop\compiler\battlesuit.sma(6) : error 021
symbol already defined"register_plugin"
// C:\Documents and Settings\*****\Desktop\compiler\battlesuit.sma(14) : error 02
9invalid expressionassumed zero
// C:\Documents and Settings\*****\Desktop\compiler\battlesuit.sma(22) : warning
203symbol is never used"client_putinserver"
//
// 2 Errors.
// Could not locate output file C:\Documents and Settings\*****\Desktop\compiler\
compiled\battlesuit.amx (compile failed).
//
// Compilation Time: 0.23 sec
// ----------------------------------------

Press enter to exit ... 

Also, how would i make it so only users with their steamid in a .txt file can get the bonus?

crazyeffect 01-02-2010 18:30

Re: Problems with my battlesuit plugin
 
What a shitty code, learn to code...

Some basics
- register_plugin has to be in public plugin_init
- clean up your code, it's messy
- the AUTHOR, NAME and VERSION of your register_plugin must be between 2 " ("1.0")
- 'new health, armor & maxspeed' must be in public client_putinserver
- there is no such thing as cs_set_user_health & cs_set_user_maxspeed
- why are you using 'id' if it's not defined?
- 'armor +50' and all that shit, isn't possible... How do you think?

Fix those things first & then ask for help :P

r4ndomz 01-02-2010 19:47

Re: Problems with my battlesuit plugin
 
Jesus, i think that was a bad reply, not because it wasnt right but because you were acting like im a pro scripter and im just one week into trying to learn this stuff, and i think im doing good.

Thx anyway it worked and i ended up taking everything out accept for gravity.

http://www.amxmodx.org/funcwiki.php?go=inc&id=7. There is actually those functions, you got it backwards. There is also both get user and set user armor in here http://www.amxmodx.org/funcwiki.php?go=inc&id=11

Still, How do i make it so only people with their steamid's in a txt file get the gravity etc?


All times are GMT -4. The time now is 04:09.

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