EXP (experience over time)
#1

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
Reply
#2

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
Reply
#3

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;
}
Reply
#4

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
Reply
#5

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"
Reply
#6

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
Reply
#7

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.
Reply
#8

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.
Reply
#9

sorry i'm new in this... i don't understand can anyone wite details where what should be ?

THANKS alot
Reply
#10

i understood and made no need help anymore THANKS
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)