Raised This Month: $ Target: $400
 0% 

what's wrong?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 08-06-2008 , 11:33   what's wrong?
Reply With Quote #1

hey guys... i make this code..but one error...can you help me?


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;

__________________

Last edited by tuty; 08-06-2008 at 11:36.
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-06-2008 , 11:35   Re: what's wrong?
Reply With Quote #2

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
__________________
xPaw is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-06-2008 , 11:38   Re: what's wrong?
Reply With Quote #3

strcmp(sClassName, 1)

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

By the way, what the purpose of this code ?
__________________
Arkshine is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 08-06-2008 , 12:11   Re: what's wrong?
Reply With Quote #4

Quote:
Originally Posted by xPaw View Post
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
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-06-2008 , 12:17   Re: what's wrong?
Reply With Quote #5

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.
__________________
Arkshine is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 08-06-2008 , 12:20   Re: what's wrong?
Reply With Quote #6

please give me that code...you are tb
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-06-2008 , 12:47   Re: what's wrong?
Reply With Quote #7

Show me your code instead.
__________________
Arkshine is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 08-06-2008 , 14:08   Re: what's wrong?
Reply With Quote #8

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.
zwfgdlc is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 08-06-2008 , 16:10   Re: what's wrong?
Reply With Quote #9

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.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
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 05:37.


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