AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   XP system help (https://forums.alliedmods.net/showthread.php?t=6018)

XsupamanX 09-19-2004 14:57

XP system help
 
Ok ppl im working on a xp based plugin and cant get that damm xp change i made it show p on screen like XP:0 when i wana add xp like this code:
XP[id] + 4 with a cmd to test it it doesnt change how can i make it change plz help thx in advance

FeuerSturm 09-19-2004 15:14

use
Code:

xp[id] += 4

XsupamanX 09-19-2004 15:21

Code:

//AMXX Plugin by SupaMan represents a MMORPG game MU (www.muonline.com)
//CMDS:
//
//CVARS:
//mu_savexp default 1 //saves xp into fles
/////////////////////////////////////////////INCLUDES///////////////////////////////////////////////
#include <amxmod>
#include <string>
#define HMCHAN_NOTICE 504
#define HMCHAN_PLAYERINFO 1089
/////////////////////////////////////////////precache///////////////////////////////////////////////
public plugin_precache() {
if (file_exists("sound/MU/iTitle.wav")) precache_sound("MU/iTitle.wav")
}
/////////////////////////////////////////////plugin/////////////////////////////////////////////////
public plugin_init() {
register_cvar("mu_savexp", "1",FCVAR_SERVER)
set_task(120.0, "servernotice", 0, "", 0, "b")
set_task(1.0, "statmenu", 0, "", 0, "b")
register_clcmd("mu_addxp","addxp")
register_clcmd("mu_addxp2","addxp2")
register_plugin("MU Mod", "0.3", "SupaMan")
}
/////////////////////////////////////////////STATS//////////////////////////////////////////////////
new XP[33] = 16
/////////////////////////////////////////////anounce///////////////////////////////////////////////
public servernotice(id) {
set_hudmessage(200,200,200,-1.0,0.30,5,6.0,12.0,0.1,0.5,HMCHAN_NOTICE)
show_hudmessage(0, "Sitas servas naudoja MU plugina pagal SupaMan")
}
public statmenu(id){
set_hudmessage(75,200,200,-1.0,0.86,0,6.0,2.0,0.1,0.5,HMCHAN_PLAYERINFO)
show_hudmessage (id,"EXP:%d",XP[id])
}
public addxp(id){
if(XP[id] > 1)
{
XP[id]=XP[id]+=4
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

public addxp2(id){
XP[id] += 4
return PLUGIN_CONTINUE
}

this is the code doesnt work how you told me

FeuerSturm 09-19-2004 15:22

Code:

XP[id]=XP[id]+=4
should be
Code:

XP[id]+=4

XsupamanX 09-19-2004 15:27

well look at the public addxp2 it has the same thing but doesnt work to maybe some strings i gota do? duno im totaly lost

FeuerSturm 09-19-2004 15:30

why do you do that:

Code:

new XP[33] = 16
i don't see a sense in that.

change it to
Code:

new XP[33]
and try again :wink:

XsupamanX 09-19-2004 15:32

ok i will anyway thx for helping me ;)
edit:
nope doesnt work im thinking maybe i should do something in the the public where i show my exp on the screen? it refreshes every second

XsupamanX 09-20-2004 09:10

PPL plz help anyone who have made an XP system i need this badly :)
anyone help? or doesnt ayone know how to do this?

XsupamanX 09-20-2004 10:48

Erm who made the w3 plugin i looked in his plugin and i would like to aks him to explain alitle how he made it work

twistedeuphoria 09-20-2004 11:34

Try registering them as concmds
Code:
register_concmd("mu_addxp","addxp",ADMIN_SLAY,"<username> Add xp.")
and
Code:
register_concmd("mu_addxp2","addxp2",ADMIN_SLAY,"<username> Add xp")
Also, your commands should
Code:
 return PLUGIN_HANDLED
so it doesn't say Invalid Command:mu_addxp when you use it.


All times are GMT -4. The time now is 17:26.

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