Raised This Month: $ Target: $400
 0% 

function or declatration error and set_hudmessage


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
Howdy!
Senior Member
Join Date: Feb 2007
Old 05-11-2009 , 11:30   Re: function or declatration error and set_hudmessage
#1

Quote:
Originally Posted by ~Ice*shOt View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <colorchat>
new const levelup[] = { "misc/levelup.wav" }
new const 
RANKS[20][] = {
"First"// 0 Level
"First"// 1 Level
"First"// 2 Level
"Super Natural"// 3 Level
"Super Natural"// 4 Level
"Super Natural"// 5 Level
"Tank"// 6 Level
"Tank"// 7 Level
"Tank"// 8 Level
"Posion"// 9 Level
"Posion"// 10 Level
"Posion"// 11 Level
"Runner"// 12 Level
"Runner"// 13 Level
"Runner"// 14 Level
"Hiper Electro"// 15 Level
"Hiper Electro"// 16 Level
"Hiper Electro"// 17 Level
"Mystic Jumper"// 18 Level
"Mystic Jumper" // 19 Level
}
new const 
LEVELS[20] = {
100
300,
600,
1000,
1500,
2100,
2800,
3600,
4500,
5500,
6600,
7800,
9100,
10500
12000,
13600,
15400,
17300
19300
21400
}
new 
PlayerXP[33],PlayerLevel[33],PlayerRank[33]
new 
XP_Kill,SaveXP
public plugin_precache()
register_forward(FM_Spawn"fwdSpawn");
public 
plugin_init()
{
register_plugin("Mystic-XP""1.0""xFrost");
register_event("DeathMsg""event_deathmsg""a");
TeamInfo get_user_msgid("TeamInfo");
SayText get_user_msgid("SayText");
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1);
SaveXP register_cvar("SaveXP","1")
XP_Kill=register_cvar("XP_per_kill""10")

register_clcmd("say level""ShowLevel")
register_clcmd("say_team level""ShowLevel")
}
public 
event_deathmsg()
{
new 
attacker read_data)
new 
headshot read_data)
new 
clipammoweapon get_user_weapon(attacker,clip,ammo);
while(
PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]])
{
ColorChat(0GREEN"[^x01Mystic-XP^x03]^x01 Congratulations!^x04 You are a level^x01 %i!^x03",PlayerLevel[attacker]);
PlayerLevel[attacker] += 0
}
ShowLevel(attacker)
SaveData(attacker)
}
public 
ShowLevel(id)
{
ColorChat(0GREEN"^x03Level ^x04- ^x01[ ^x03%i ^x04/ ^x03 19 ^x01] ^x03XP ^x04- ^x01[ ^x03%i ^x01] ^x03Rank ^x04- ^x01[ ^x03%s ^x01]",PlayerLevel[id],PlayerXP[id],RANKS[PlayerRank[id]]);
return 
PLUGIN_HANDLED;
}
PlayerXP[attacker] += get_pcvar_num(XP_Kill)

set_hudmessage(0255500.500.3312.02.0)
show_hudmessage(0"+%d XP For Kill"get_pcvar_num(XP_Kill))
}
public 
client_connect(id)
{
if(
get_pcvar_num(SaveXP) == 1)
{
LoadData(id)
}
}
public 
client_disconnect(id)
{
if(
get_pcvar_num(SaveXP) == 1)
{
SaveData(id)
}
PlayerXP[id] = 0
PlayerLevel
[id] = 0
PlayerRank
[id] = 0
}
public 
SaveData(id)
{
new 
AuthID[35]
get_user_authid(id,AuthID,34)
new 
vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s-Mod",AuthID)
format(vaultdata,255,"%i#%i#",PlayerXP[id],PlayerLevel[id])
return 
PLUGIN_CONTINUE
}
public 
LoadData(id)
{
new 
AuthID[35]
get_user_authid(id,AuthID,34)
new 
vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s-Mod",AuthID)
format(vaultdata,255,"%i#%i#",PlayerXP[id],PlayerLevel[id])
replace_all(vaultdata255"#"" ")
new 
playerxp[32], playerlevel[32]
parse(vaultdataplayerxp31playerlevel31)
PlayerXP[id] = str_to_num(playerxp)
PlayerLevel[id] = str_to_num(playerlevel)
return 
PLUGIN_CONTINUE
}
public 
fwdSpawn(iEnt)
{
static 
s_szClassName[32];
pev(iEntpev_classnames_szClassName31);
if (
equal(s_szClassName"func_buyzone"))
return 
FMRES_SUPERCEDE;
return 
FMRES_IGNORED;
}
public 
fw_PlayerSpawn_Post(id)
{
if (!
is_user_alive(id))
return
switch (
PlayerLevel[id])
{
case 
0:
{
give_item (id"weapon_glock18"
give_itemid"ammo_9mm"
give_itemid"ammo_9mm"
give_itemid"ammo_9mm"
give_itemid"ammo_9mm"
give_itemid"ammo_9mm")

case 
1

give_item (id"weapon_usp"); 
give_itemid"ammo_45acp"
give_itemid"ammo_45acp"
give_itemid"ammo_45acp"
give_itemid"ammo_45acp"
give_itemid"ammo_45acp"
give_item(id"weapon_smokegrenade")

case 
2

give_item (id"weapon_p228"); 
give_itemid"ammo_350sig"
give_itemid"ammo_350sig"
give_itemid"ammo_350sig"
give_itemid"ammo_350sig"
give_itemid"ammo_350sig")
give_item(id"weapon_smokegrenade")

case 
3

give_item (id"weapon_fiveseven");
give_itemid"ammo_57mm"
give_itemid"ammo_57mm"
give_itemid"ammo_57mm"
give_itemid"ammo_57mm"
give_itemid"ammo_57mm")
give_item(id"weapon_smokegrenade")

case 
4

give_item (id"weapon_deagle");
give_itemid"ammo_50ae"
give_itemid"ammo_50ae"
give_itemid"ammo_50ae"
give_itemid"ammo_50ae"
give_itemid"ammo_50ae")
give_item(id"weapon_flashbang")
give_item(id"weapon_flashbang")

case 
5

give_item (id"weapon_elite");
give_itemid"ammo_9mm"
give_itemid"ammo_9mm"
give_itemid"ammo_9mm"
give_itemid"ammo_9mm"
give_itemid"ammo_9mm")
give_item(id"weapon_hegrenade")

case 
6

give_item (id"weapon_tmp");
give_itemid"ammo_9mm"
give_itemid"ammo_9mm")
give_itemid"ammo_9mm")
give_itemid"ammo_9mm")
give_itemid"ammo_9mm")
give_item(id"weapon_smokegrenade")
}
case 
7

give_item (id"weapon_mac10"); 
give_itemid"ammo_45acp"
give_itemid"ammo_45acp"
give_itemid"ammo_45acp"
give_itemid"ammo_45acp"
give_itemid"ammo_45acp")
give_item(id"weapon_smokegrenade")

case 
8

give_item (id"weapon_ump45");
give_itemid"ammo_45acp")
give_itemid"ammo_45acp"
give_itemid"ammo_45acp"
give_itemid"ammo_45acp"
give_itemid"ammo_45acp")
give_item(id"weapon_smokegrenade")

case 
9

give_item (id"weapon_mp5navy");
give_itemid"ammo_9mm")
give_itemid"ammo_9mm")
give_itemid"ammo_9mm")
give_itemid"ammo_9mm")
give_itemid"ammo_9mm")
give_item(id"weapon_smokegrenade")

case 
10

give_item (id"weapon_p90"); 
give_itemid"ammo_57mm")
give_itemid"ammo_57mm")
give_itemid"ammo_57mm")
give_itemid"ammo_57mm")
give_itemid"ammo_57mm")
give_item(id"weapon_smokegrenade")

case 
11

give_item (id"weapon_famas");
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_item(id"weapon_hegrenade")

case 
12

give_item (id"weapon_galil");
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_item(id"weapon_smokegrenade")

case 
13

give_item (id"weapon_m3");
give_itemid"ammo_buckshot")
give_itemid"ammo_buckshot")
give_itemid"ammo_buckshot")
give_itemid"ammo_buckshot")
give_itemid"ammo_buckshot")
give_item(id"weapon_flashbang")
give_item(id"weapon_flashbang")

case 
14

give_item (id"weapon_ak47");
give_itemid"ammo_762nato")
give_itemid"ammo_762nato")
give_itemid"ammo_762nato")
give_itemid"ammo_762nato")
give_itemid"ammo_762nato")
give_item(id"weapon_smokegrenade")

case 
15

give_item (id"weapon_m4a1");
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_item(id"weapon_smokegrenade")

case 
16:
{
give_item (id"weapon_sg550");
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_item(id"weapon_smokegrenade")

case 
17

give_item (id"weapon_g3sg1");
give_itemid"ammo_762nato")
give_itemid"ammo_762nato")
give_itemid"ammo_762nato")
give_itemid"ammo_762nato")
give_itemid"ammo_762nato")
give_item(id"weapon_hegrenade")
give_item(id"weapon_smokegrenade")

case 
18

give_item (id"weapon_sg552");
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_itemid"ammo_556nato")
give_item(id"weapon_flashbang")
give_item(id"weapon_flashbang")
give_item(id"weapon_smokegrenade")

case 
19:
{
give_item (id"weapon_m249");
give_itemid"ammo_556natobox")
give_itemid"ammo_556natobox")
give_itemid"ammo_556natobox")
give_itemid"ammo_556natobox")
give_itemid"ammo_556natobox")
give_item(id"weapon_smokegrenade")
give_item(id"weapon_hegrenade")
give_item(id"weapon_flashbang")
give_item(id"weapon_flashbang")
}
}

Obviously you don't have a clue what you're doing.
__________________
[IMG]http://img221.**************/img221/5608/howdyfinnishhq2.jpg[/IMG]
Howdy! is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-11-2009 , 12:02   Re: function or declatration error and set_hudmessage
#2

Quote:
Originally Posted by Howdy! View Post
Obviously you don't have a clue what you're doing.
Read all of his threads, you will find that out real quick


@ ~Ice*shOt : 2 words of advice. Stop coding
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-11-2009 , 12:06   Re: function or declatration error and set_hudmessage
#3

Quote:
Originally Posted by YamiKaitou View Post
Read all of his threads, you will find that out real quick


@ ~Ice*shOt : 2 words of advice. Stop coding
Owned
__________________
xPaw is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 05-11-2009 , 12:12   Re: function or declatration error and set_hudmessage
#4

this man please me post code..
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-11-2009 , 12:52   Re: function or declatration error and set_hudmessage
#5

@ ~Ice*shOt :

Quote:
Originally Posted by YamiKaitou View Post
Stop coding
__________________
xPaw is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-11-2009 , 13:15   Re: function or declatration error and set_hudmessage
#6

I said post the whole FUNCTION not the whole code...
PHP Code:
public ShowLevel(id)
{
ColorChat(0GREEN"^x03Level ^x04- ^x01[ ^x03%i ^x04/ ^x03 19 ^x01] ^x03XP ^x04- ^x01[ ^x03%i ^x01] ^x03Rank ^x04- ^x01[ ^x03%s ^x01]",PlayerLevel[id],PlayerXP[id],RANKS[PlayerRank[id]]);
return 
PLUGIN_HANDLED;
}
PlayerXP[attacker] += get_pcvar_num(XP_Kill)

set_hudmessage(0255500.500.3312.02.0)
show_hudmessage(0"+%d XP For Kill"get_pcvar_num(XP_Kill))
}
public 
client_connect(id)
{
if(
get_pcvar_num(SaveXP) == 1)
{
LoadData(id)
}

as far as I can see your code isn't in a function, no wonder you get that "already defined" error...

also use the damn indentation ! otherwise you SURELY don't understand anything from your own code even if you happen to know what everything does... this means, for short, order your code ! use spaces and tabs... and don't get greedy on them because they won't affect the plugin's performance OR compile time, that only helps the coders reading the code !
__________________
Hunter-Digital is offline
Metanabol
Member
Join Date: Feb 2009
Old 05-11-2009 , 14:46   Re: function or declatration error and set_hudmessage
#7

lets make ice-shot fan club! it will be very interesting fixing his code "x" times...

new x = infinity
check_post(id, ice-shot, "failed scripter")
ban(ice-shot)

public ban(ice-shot)
{
server_cmd(amx_banip "ICE-sHOT 9999999 Stupid lamer")
client_print(ice-shot, print_chat, "Bye bye ;* see ya later")
}
Metanabol is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-11-2009 , 17:52   Re: function or declatration error and set_hudmessage
#8

Quote:
Originally Posted by YamiKaitou View Post
Read all of his threads, you will find that out real quick


@ ~Ice*shOt : 2 words of advice. Stop coding
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Closed Thread



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:35.


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