AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   what's wrong? (https://forums.alliedmods.net/showthread.php?t=75484)

tuty 08-06-2008 11:33

what's wrong?
 
hey guys... i make this code..but one error...can you help me? :cry:


PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>

#define PLUGIN "NihilanthBomb"
#define VERSION "1.0"
#define AUTHOR "tuty"



new const gC4Model[] = "models/nihilanth.mdl";


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
    
register_forward(FM_SetModel"Bomb_Model");
    
register_forward(FM_Think"c4place");
    
}
public 
plugin_precache()
{
    
precache_model(gC4Model);
}

public 
c4place(Ent)
{
    if(!
pev_valid(Ent))
              return 
FMRES_IGNORED;
    
    static 
sClassName[32];
    
pev(Entpev_classnamesClassNamesizeof sClassName -1);
    
    if(!
strcmp(sClassName1))
    {
        
engfunc(EngFunc_RemoveEntityEnt);
    }
    return 
FMRES_IGNORED;
}
public 
Bomb_Model(Ent, const szModel[])
{
    if(!
pev_valid(Ent))
              return 
FMRES_IGNORED;
    if(!
strcmp(szModel"models/w_c4.mdl"))
    {
        
engfunc(EngFunc_SetModelEntgC4Model);
        
        return 
FMRES_SUPERCEDE;
    }
    return 
FMRES_IGNORED;



xPaw 08-06-2008 11:35

Re: what's wrong?
 
Code:

/home/groups/amxmodx/tmp3/textIxmDkZ.sma(32) : error 001: expected token: ",", but found "-integer value-"
/home/groups/amxmodx/tmp3/textIxmDkZ.sma(32) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/textIxmDkZ.sma(32) : error 001: expected token: ";", but found ")"
/home/groups/amxmodx/tmp3/textIxmDkZ.sma(32) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/textIxmDkZ.sma(32) : fatal error 107: too many error messages on one line

its not 1 error :)
going watch

Arkshine 08-06-2008 11:38

Re: what's wrong?
 
strcmp(sClassName, 1)

You compare a string with 1. Is '1' a string ?. No.

By the way, what the purpose of this code ?

tuty 08-06-2008 12:11

Re: what's wrong?
 
Quote:

Originally Posted by xPaw (Post 665487)
Code:

/home/groups/amxmodx/tmp3/textIxmDkZ.sma(32) : error 001: expected token: ",", but found "-integer value-"
/home/groups/amxmodx/tmp3/textIxmDkZ.sma(32) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/textIxmDkZ.sma(32) : error 001: expected token: ";", but found ")"
/home/groups/amxmodx/tmp3/textIxmDkZ.sma(32) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/textIxmDkZ.sma(32) : fatal error 107: too many error messages on one line

its not 1 error :)
going watch

man 1 error check again :|

Arkshine 08-06-2008 12:17

Re: what's wrong?
 
Changing by a random string instead of '1'. It compiles fine.

Quote:

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

Header size: 328 bytes
Code size: 736 bytes
Data size: 448 bytes
Stack/heap size: 16384 bytes; estimated max. usage=41 cells (164 bytes)
Total requirements: 17896 bytes
Done.

tuty 08-06-2008 12:20

Re: what's wrong?
 
please give me that code...you are tb :up:

Arkshine 08-06-2008 12:47

Re: what's wrong?
 
Show me your code instead.

zwfgdlc 08-06-2008 14:08

Re: what's wrong?
 
Code:
public c4place(Ent) {     if(!pev_valid(Ent))         return FMRES_IGNORED;         static sClassName[32];     pev(Ent, pev_classname, sClassName, sizeof sClassName -1);         if(!strcmp(sClassName, 1))     {         engfunc(EngFunc_RemoveEntity, Ent);     } }
change to
Code:
public c4place(Ent) {     if(!pev_valid(Ent))         return FMRES_IGNORED;         static sClassName[32];     pev(Ent, pev_classname, sClassName, sizeof sClassName -1);         if(!strcmp(sClassName, "1"))     {         engfunc(EngFunc_RemoveEntity, Ent);     } }
1 is an integer, not a string.

Xanimos 08-06-2008 16:10

Re: what's wrong?
 
Honestly you can remove that whole function. It serves no purpose what-so-ever. It looks like you are trying to remove the bomb, but then in the next function you try and change the model of it.


All times are GMT -4. The time now is 05:37.

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