AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Compile errors (https://forums.alliedmods.net/showthread.php?t=117951)

r4ndomz 02-06-2010 13:16

Compile errors
 
What are my errors? I cant seem to find what im doing wrong.


PHP Code:

#include <amxmodx>
#include <fun>
#include <csx>
#include <fakemeta>

new hasnades[33]

public 
plugin_init()
{
        
register_plugin("Infinite-Nades","1.0","r4nDoMz")
}


public 
client_connect(id)
{
    
hasnades(id) = 1
}

public 
client_disconnect(id)
{
    
hasnades(id) = 0
}

public 
grenade_throw(id,_,_)
{
    if(!
hasnades[id] || is_user_alive) {
        return
    }
    new 
wpid get_user_weapon(id)
    if(
wpid == CSW_HEGRENADE) {
        return
    }
    else
    {
        
give_item(id"weapon_hegrenade")
    }

    if(
wpid == CSW_SMOKEGRENADE) {
        return
    }
    else
    {
        
give_item(id"weapon_smokegrenade")
    }    

    if(
wpid == CSW_FLASHBANG) {
        return
    }
    else
    {
        
give_item(id"weapon_flashbang")
    }



PHP Code:

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


//// infinite-nades.sma
// C:\Documents and Settings\nick\Desktop\compiler1\infinite-nades.sma(16) : err
or 012invalid function callnot a valid address
// C:\Documents and Settings\nick\Desktop\compiler1\infinite-nades.sma(16) : war
ning 215expression has no effect
// C:\Documents and Settings\nick\Desktop\compiler1\infinite-nades.sma(16) : err
or 001expected token";"but found ")"
// C:\Documents and Settings\nick\Desktop\compiler1\infinite-nades.sma(16) : err
or 029invalid expressionassumed zero
// C:\Documents and Settings\nick\Desktop\compiler1\infinite-nades.sma(16) : fat
al error 107too many error messages on one line
//
// Compilation aborted.
// 4 Errors.
// Could not locate output file C:\Documents and Settings\nick\Desktop\compiler1
\compiled\infinite-nades.amx (compile failed).
//
// Compilation Time: 0.27 sec
// ----------------------------------------

Press enter to exit ... 


Seta00 02-06-2010 13:21

Re: Compile errors
 
I have no comments on these errors.
PHP Code:

#include <amxmodx>
#include <fun>
#include <csx>
#include <fakemeta>

new hasnades[33]

public 
plugin_init()
{
        
register_plugin("Infinite-Nades","1.0","r4nDoMz")
}


public 
client_connect(id)
{
    
hasnades[id] = 1
}

public 
client_disconnect(id)
{
    
hasnades[id] = 0
}

public 
grenade_throw(id,greindex,wpid)
{
    if(!
hasnades[id] || is_user_alive) {
        return
    }
    new 
wpid get_user_weapon(id)
    if(
wpid == CSW_HEGRENADE) {
        return
    }
    else
    {
        
give_item(id"weapon_hegrenade")
    }

    if(
wpid == CSW_SMOKEGRENADE) {
        return
    }
    else
    {
        
give_item(id"weapon_smokegrenade")
    }    

    if(
wpid == CSW_FLASHBANG) {
        return
    }
    else
    {
        
give_item(id"weapon_flashbang")
    }



AND this code does anything but giving infinite nades.

Kreation 02-06-2010 13:24

Re: Compile errors
 
PHP Code:

new hasnades[33]

public 
plugin_init()
{
        
register_plugin("Infinite-Nades","1.0","r4nDoMz")
}


public 
client_connect(id)
{
    
hasnades(id) = 1
}

public 
client_disconnect(id)
{
    
hasnades(id) = 0


To -->

PHP Code:

new hasnades[33]

public 
plugin_init()
{
        
register_plugin("Infinite-Nades","1.0","r4nDoMz")
}


public 
client_connect(id)
{
    
hasnades[id] = 1
}

public 
client_disconnect(id)
{
    
hasnades[id] = 0



Mxnn 02-06-2010 13:25

Re: Compile errors
 
You forgot this..
PHP Code:

    if(!hasnades[id] || is_user_alive

-->
PHP Code:

    if(!hasnades[id] || is_user_alive(id)) 


r4ndomz 02-06-2010 13:29

Re: Compile errors
 
Thats what i want it to do lol to whom who said it only gives you infinite nades. It was in the title.

Thanks to all of you guys. I made silly mistakes lol =)

Seta00 02-06-2010 13:35

Re: Compile errors
 
I've said it doesn't give infinite nades, and there's another error:
Code:

public grenade_throw(id,_,_) -> public grenade_throw(id, greindex, wpid)
And you have to remove the declaration of wpid and use the parameter.
Anyway, all compile errors are fixed on my first post, but your logic is all wrong.

vilaemail 02-06-2010 13:50

Re: Compile errors
 
Learn to read the compiler errors. That way you would fix those "silly mistakes".

r4ndomz 02-06-2010 15:15

Re: Compile errors
 
Seta thx but how is my logic wrong? I found out that it doesnt give you infinite nades. What exactly did i do wrong?

wrecked_ 02-06-2010 15:35

Re: Compile errors
 
PHP Code:

if(!hasnades[id] || is_user_alive) { 

-->
PHP Code:

if(!hasnades[id] || is_user_alive(id)) { 


r4ndomz 02-06-2010 17:25

Re: Compile errors
 
thats been pointed out quite a few times. What else is wrong


All times are GMT -4. The time now is 07:24.

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