EXP (experience over time) -
gurufan - 05.05.2010
HI everyone,
Can anybody say me how to make and where what to write to make timed EXP system...
60 seconds online and player gets 1 EXP point THANK's
Re: EXP (experience over time) -
Torran - 05.05.2010
pawn Код:
new exptimer;
public OnPlayerConnect(playerid)
{
exptimer = SetTimerEx("EXP", 1000, 1, "i", playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason[])
{
KillTimer(exptimer);
return 1;
}
forward EXP(playerid);
public EXP(playerid)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
return 1;
}
If theres something in your script actulley called a EXP point then edit the setplayerscore
Re: EXP (experience over time) -
shady91 - 05.05.2010
Quote:
Originally Posted by Joe Torran C
pawn Код:
new exptimer;
public OnPlayerConnect(playerid) { exptimer = SetTimerEx("EXP", 1000, 1, "i", playerid); return 1; }
public OnPlayerDisconnect(playerid, reason[]) { KillTimer(exptimer); return 1; }
forward EXP(playerid); public EXP(playerid) { SetPlayerScore(playerid, GetPlayerScore(playerid) +1); return 1; }
If theres something in your script actulley called a EXP point then edit the setplayerscore
|
That's wrong you missed something it should be
pawn Код:
new exptimer[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
exptimer[playerid] = SetTimerEx("EXP", 60*1000, 1, "i", playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason[])
{
KillTimer(exptimer[playerid]);
return 1;
}
forward EXP(playerid);
public EXP(playerid)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
return 1;
}
Re: EXP (experience over time) -
Torran - 05.05.2010
Quote:
Originally Posted by Shady91
Quote:
Originally Posted by Joe Torran C
pawn Код:
new exptimer;
public OnPlayerConnect(playerid) { exptimer = SetTimerEx("EXP", 1000, 1, "i", playerid); return 1; }
public OnPlayerDisconnect(playerid, reason[]) { KillTimer(exptimer); return 1; }
forward EXP(playerid); public EXP(playerid) { SetPlayerScore(playerid, GetPlayerScore(playerid) +1); return 1; }
If theres something in your script actulley called a EXP point then edit the setplayerscore
|
That's wrong you missed something it should be
pawn Код:
new exptimer[MAX_PLAYERS];
public OnPlayerConnect(playerid) { exptimer[playerid] = SetTimerEx("EXP", 60*1000, 1, "i", playerid); return 1; }
public OnPlayerDisconnect(playerid, reason[]) { KillTimer(exptimer[playerid]); return 1; }
forward EXP(playerid); public EXP(playerid) { SetPlayerScore(playerid, GetPlayerScore(playerid) +1); return 1; }
|
Oh yeah lol :P
Why i put it for a second idk :P
Re: EXP (experience over time) -
gurufan - 05.05.2010
thanks ,but something is wrong with this...
(2240
: error 021: symbol already defined: "OnPlayerConnect"
(22413) : error 025: function heading differs from prototype
(22414) : error 021: symbol already defined: "OnPlayerDisconnect"
Re: EXP (experience over time) -
Torran - 05.05.2010
Dont copy and paste the whole thing,
If we used a callback you already have then take the contents and put it inside the callback
Re: EXP (experience over time) -
shady91 - 05.05.2010
Quote:
Originally Posted by Joe Torran C
Quote:
Originally Posted by Shady91
Quote:
Originally Posted by Joe Torran C
pawn Код:
new exptimer;
public OnPlayerConnect(playerid) { exptimer = SetTimerEx("EXP", 1000, 1, "i", playerid); return 1; }
public OnPlayerDisconnect(playerid, reason[]) { KillTimer(exptimer); return 1; }
forward EXP(playerid); public EXP(playerid) { SetPlayerScore(playerid, GetPlayerScore(playerid) +1); return 1; }
If theres something in your script actulley called a EXP point then edit the setplayerscore
|
That's wrong you missed something it should be
pawn Код:
new exptimer[MAX_PLAYERS];
public OnPlayerConnect(playerid) { exptimer[playerid] = SetTimerEx("EXP", 60*1000, 1, "i", playerid); return 1; }
public OnPlayerDisconnect(playerid, reason[]) { KillTimer(exptimer[playerid]); return 1; }
forward EXP(playerid); public EXP(playerid) { SetPlayerScore(playerid, GetPlayerScore(playerid) +1); return 1; }
|
Oh yeah lol :P
Why i put it for a second idk :P
|
also you made it
new exptimer
when it should be
new exptimer[MAX_PLAYERS];
other wise if one person left all the timer would of been killed.
Quote:
Originally Posted by gurufan
thanks ,but something is wrong with this...
(2240 : error 021: symbol already defined: "OnPlayerConnect"
(22413) : error 025: function heading differs from prototype
(22414) : error 021: symbol already defined: "OnPlayerDisconnect"
|
that means you have
public OnPlayerConnect twice don't copy and paste this take the parts from it and add it under OnPlayerConnect etc. in your script.
Re: EXP (experience over time) -
Killa_ - 05.05.2010
Quote:
Originally Posted by gurufan
thanks ,but something is wrong with this...
(2240 : error 021: symbol already defined: "OnPlayerConnect"
(22413) : error 025: function heading differs from prototype
(22414) : error 021: symbol already defined: "OnPlayerDisconnect"
|
Dont simple copy and paste
, put for example "KillTimer(exptimer[playerid]);" under onplayerdisconnect etc.
Re: EXP (experience over time) -
gurufan - 05.05.2010
sorry i'm new in this... i don't understand can anyone wite details where what should be ?
THANKS alot
Re: EXP (experience over time) -
gurufan - 05.05.2010
i understood and made no need help anymore THANKS