Raised This Month: $ Target: $400
 0% 

Variable (array?) trouble...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BigDontCry
Member
Join Date: Nov 2007
Location: Sweden
Old 11-16-2007 , 12:04   Re: Variable (array?) trouble...
Reply With Quote #1

PHP Code:
public show_player_stats(id) {
 
 new 
bool:lvled false
 
new g_Pl_Race g_PlayerRace[id]
 
 if(
g_PlayerXP[id][g_Pl_Race] < 0) {
  
g_PlayerXP[id][g_Pl_Race] = 0
 
}
 
 if((
g_PlayerLevel[id][g_Pl_Race] < (MAX_LEVEL-1)) && (g_PlayerXP[id][g_Pl_Race] >= xplevel_lev[g_PlayerLevel[id][g_Pl_Race]+1])) {
  for(new 
= (g_PlayerLevel[id][g_Pl_Race]+1); MAX_LEVEL; ++i) {
   if(
g_PlayerXP[id][g_Pl_Race] >= xplevel_lev[i]) {
    
lvled true
    g_PlayerLevel
[id][g_Pl_Race] += i
   
}
  }
 }
 
 
set_player_race(id)
 
 
set_hudmessage(025500.020.701.05.0)
 
show_hudmessage(id"Race: %s^nLevel: %d^nXP: %d"g_PlayerRaceName[id], g_PlayerLevel[id][g_Pl_Race], g_PlayerXP[id][g_Pl_Race])
 
 if(
lvled) {
 
  
set_hudmessage(25500, -1.0, -1.010.56.0)
  
show_hudmessage(id"Congratulations! You gained a level!!!^nYou are now level %d"g_PlayerLevel[id][g_Pl_Race])
 
  if (
file_exists("sound/wishmaster/levelup2.wav")==&& is_user_alive(id)) {
   
emit_sound(id,CHAN_AUTO"wishmaster/levelup2.wav"1.0ATTN_NORM0PITCH_NORM)
  }
 }
 
 return 
PLUGIN_CONTINUE

The clients level is always "0"... It never changes...
__________________
Big Men Don't Cry

Quote:
[20:23] [email protected]: I don't know how
[20:23] [email protected]: I'm only 15
[20:23] [email protected]: I don't know anything

Last edited by BigDontCry; 11-16-2007 at 14:03.
BigDontCry 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 01:12.


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