Little XP System problem
#1

Hi everybody, im playing with the variables, and i decided to make a small XP system for my server, its not alot of code haha but here is it:

Код:
new PlayerXP[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerXP[playerid] = -5;
    SendClientMessage(playerid, 0, "You lost 5 xp points!");
	return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/xp", cmdtext, true, 10) == 0)
	{
		PlayerXP[playerid] += 50;
		return 1;
	}
	if (strcmp("/getxp", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, 0, PlayerXP[playerid]);
		return 1;
	}
	return 0;
}
But the problem is, when i have like only 2 XP points and i get killed so thats 2-4 thats not possible, but when i type /getxp (shows me how much XP i have) it says random characters, and if i do /xp (it needs to give me 50xp) and then do /getxp it says just 2 like i have 2 xp or something

Please help me out ;o
Reply


Messages In This Thread
Little XP System problem - by luckie12 - 10.05.2014, 18:30
Re: Little XP System problem - by Konstantinos - 10.05.2014, 18:36
Re: Little XP System problem - by luckie12 - 10.05.2014, 18:37
Re: Little XP System problem - by Konstantinos - 10.05.2014, 18:43
Re: Little XP System problem - by luckie12 - 10.05.2014, 18:47
Re: Little XP System problem - by luckie12 - 10.05.2014, 18:52
Re: Little XP System problem - by luckie12 - 10.05.2014, 19:11
Re: Little XP System problem - by Konstantinos - 10.05.2014, 19:19
Re: Little XP System problem - by luckie12 - 10.05.2014, 19:43
Re: Little XP System problem - by luckie12 - 10.05.2014, 20:45

Forum Jump:


Users browsing this thread: 6 Guest(s)