Experience System - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Experience System (
/showthread.php?tid=361652)
Experience System -
srcka< - 21.07.2012
how to do Experience System to climb a 1 Experience for 1 minute and with textdraws please tell me how to do this for ages looking for and can not find
Re: Experience System -
[A]ndrei - 21.07.2012
experience maybe score explain beter i do not understand...sorry :\
Re: Experience System -
srcka< - 21.07.2012
so I want every 5 hours to climb a Level but have textdraws Here's a picture might help
Re: Experience System -
srcka< - 21.07.2012
Re: Experience System -
srcka< - 21.07.2012
please help
Re: Experience System -
srcka< - 21.07.2012
i have this
where i put this ??
forward 5HoursLevelUp(playerid);
SetTimerEx("5HoursLevelUp", 18000000, true,"i",playerid); // Level up each 5 hours, put on OnPlayerConnect
public 5HoursLevelUp(playerid)
{
PlayerInfo[playerid][pLevel] += 1; // Adds 1 more level to pLevel var (Y_INI saving system)
return 1;
}
new pLevel = PlayerInfo[playerid][pLevel];
gLevel = TextDrawCreate(320.0, 240.0, pLevel); // Well, tweak it as your likeing
TextDrawShowForPlayer(playerid, gLevel); // OnPlayerConnect, also use a TextDraw string updater
Re: Experience System -
Roko_foko - 21.07.2012
pawn Код:
#define EXPERIENCE_FOR_NEXT_LEVEL 5*60*60*1000 // for 5 hours
new gPlayerExperience[MAX_PLAYERS];
OnGameModeInit()
{
SetTimer("EveryMinuteTimer",60*1000,true);
//...
}
forward public EveryMinuteTimer();
public EveryMinuteTimer();
{
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(playerid) || IsPlayerNPC(playerid))continue;
if(++gPlayerExperience[playerid]==EXPERIENCE_FOR_NEXT_LEVEL)
{
gPlayerExperience[playerid]=0;
PlayerInfo[playerid][pLevel]++;
}
//You can here show player textdraw so it looks like on the Screen shoot
// "Experience: gPlayerExperience[playerid]/EXPERIENCE_FOR_NEXT_LEVEL"(Ie: Experience: 30/300000000)
}
}
OnPlayerDiscconnect(playerid,reason)
{
//save stats, ATTENTION -save both gPlayerExperience[playerid] and PlayerInfo[playerid][pLevel]
gPlayerExperience[playerid]=0;
PlayerInfo[playerid][pLevel]=0;
}
I would do this way.
PS: put [pawn] CODE ['/'pawn] without '-s if you want your code to look better
Re: Experience System -
srcka< - 22.07.2012
Код:
forward 5HoursLevelUp(playerid);
SetTimerEx("5HoursLevelUp", 18000000, true,"i",playerid); // Level up each 5 hours, put on OnPlayerConnect
public 5HoursLevelUp(playerid)
{
PlayerInfo[playerid][pLevel] += 1; // Adds 1 more level to pLevel var (Y_INI saving system)
return 1;
}
new pLevel = PlayerInfo[playerid][pLevel];
gLevel = TextDrawCreate(320.0, 240.0, pLevel); // Well, tweak it as your likeing
TextDrawShowForPlayer(playerid, gLevel); // OnPlayerConnect, also use a TextDraw string updater
here is on pawn code
P.S your cmd have textdraws ?
Re: Experience System -
srcka< - 22.07.2012
can you get me a full filterscript with no erorrs ?