Raised This Month: $ Target: $400
 0% 

Just a small issue...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Theshooter7
Junior Member
Join Date: Apr 2007
Old 04-11-2007 , 20:00   Just a small issue...
Reply With Quote #1

I can't understand why I receive the warning "Tag Mismatch on line 335".

PHP Code:
new XP[33],XP2LVL[33],LVL[33],KStreak[33];

new 
Float:XPMultiply[33];

new 
XPGain 2;

public 
client_death(kid,vid) {
    
XP[kid] = XPMultiply[kid] * XPGain//<- this would be line 335. :/
    
KStreak[kid]++;
    if(
KStreak[kid] >= 3)
    {
        
KStreak[kid] = 0;
        
XPMultiply[kid] += 0.1;
    }
    
XPMultiply[vid] = 1.0
    
if(KStreak[vid] == 0) { XPMultiply[vid] = -0.1; }
    
KStreak[vid] = 0;

Thanks for your help.
Theshooter7 is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 04-11-2007 , 20:21   Re: Just a small issue...
Reply With Quote #2

Hi, try to use:

Code:
XP[kid] = XPMultiply[kid] * float(XPGain)
GL
alien is offline
Send a message via ICQ to alien
Theshooter7
Junior Member
Join Date: Apr 2007
Old 04-11-2007 , 20:26   Re: Just a small issue...
Reply With Quote #3

No effect. I appreciate the attempt. I really don't know why this is occurring. It's perfectly fine with all the other lines that have similar formulas...

[EDIT] By the way, this is for The Specialists, if it has any meaning.

Last edited by Theshooter7; 04-11-2007 at 20:30.
Theshooter7 is offline
Theshooter7
Junior Member
Join Date: Apr 2007
Old 04-11-2007 , 21:01   Re: Just a small issue...
Reply With Quote #4

I apologize for double posting, but another slight issue has crept up. The following code doesn't seem to display the proper numbers, either because of an issue with how the array indexes are being read, or because the hudmessage is not set up properly.

PHP Code:
public playerhud(id) {
    
set_hudmessage(255001.00.406.012.0)
    
show_hudmessage(id"Level: %d ^nXP: %d / %d",LVL[id],XP[id],XP2LVL[id])
}

public 
client_connect(id) {
    
read_playerdata(id);
    
XPMultiply[id] = 1.0;
    
KStreak[id] = 0
    
if(LVL[id] < 2)
    {
    
LVL[id] = 1
    XP2LVL
[id] = 50
    
}
}

public 
client_disconnect(id) {
    
write_playerdata(id);
    
XP[id] = 0;
    
XP2LVL[id] = 0;
    
LVL[id] = 0;
    
XPMultiply[id] = 1.0;
    
KStreak[id] = 0;

Another thing I'd like to know; is it possible to determine either a player's team or their player model? I intend to have one team of players have double health, while the other have no footstep noises.

Last edited by Theshooter7; 04-11-2007 at 21:04.
Theshooter7 is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 04-11-2007 , 21:22   Re: Just a small issue...
Reply With Quote #5

PHP Code:
new g_model[33][33]
 
get_user_info(id,"model",g_model[id],32
wonsae is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 04-11-2007 , 21:45   Re: Just a small issue...
Reply With Quote #6

Ah sorry, I must be blind ...

You're assigning a float value to an integer variable. Just round the value first using floatround().

PHP Code:
XP[kid] = floatround(XPMultiply[kid] * XPGain
:-)
alien is offline
Send a message via ICQ to alien
Theshooter7
Junior Member
Join Date: Apr 2007
Old 04-11-2007 , 21:53   Re: Just a small issue...
Reply With Quote #7

Thanks alien, that works well enough.

@wonsae: With what I tried to use, I got this:

PHP Code:
ErrorInvalid expressionassumed zero on line 351 
PHP Code:
public clrespawn(id) {
    new 
g_model[33][33];
    
get_user_info(id,"model",g_model[id][32],32)
    if(
strlen(g_model[id][]) == 5)
    {
        
set_user_footsteps(id,1);
        
set_user_health(id,150);
        
set_user_maxspeed(id,get_user_maxspeed(id) * 0.75);
    }
    else
    {
        
set_user_armor(id,100);
    }

Theshooter7 is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 04-11-2007 , 22:07   Re: Just a small issue...
Reply With Quote #8

Not sure whether this is the line but

PHP Code:
if(strlen(g_model[id][]) == 5
should be

PHP Code:
if(strlen(g_model[id]) == 5
Hope it'll help.
alien is offline
Send a message via ICQ to alien
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 04-11-2007 , 22:11   Re: Just a small issue...
Reply With Quote #9

Code:
public clrespawn(id) {     new g_model[33];     get_user_info(id,"model",g_model,32)     if(strlen(g_model) == 5)     {         set_user_footsteps(id,1);         set_user_health(id,150);         set_user_maxspeed(id,get_user_maxspeed(id) * 0.75);     }     else     {         set_user_armor(id,100);     } }
Deviance is offline
Theshooter7
Junior Member
Join Date: Apr 2007
Old 04-11-2007 , 22:32   Re: Just a small issue...
Reply With Quote #10

That worked perfectly Deviance! Thanks a ton!

Final issue still remains: I can't get the XP numbers to show properly, they just show up as 0's. Should I post the .sma file for this one?
Theshooter7 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 06:44.


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