Timer Score - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Timer Score (
/showthread.php?tid=246120)
Timer Score -
[M.A]Angel[M.A] - 03.04.2011
Hello,
How can i add Auto Timer SetScore +1 every 1 min set to players score +1 ?
______________________
Re: Timer Score -
HyperZ - 03.04.2011
OnPlayerConnect:
pawn Код:
SetTimerEx("GiveScore", 60*1000, true, "i", playerid);
Somewhere in your script:
pawn Код:
forward GiveScore(playerid);
public GiveScore(playerid)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
}
Re: Timer Score -
sciman001 - 03.04.2011
easy. code:
pawn Код:
public OnPlayerConnect(playerid)
{
SetTimerEx("score", 5000, true, "i", playerid);
return 1;
}
forward score(playerid);
public score(playerid)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
}
Try that.
Re: Timer Score -
jejemonerz123 - 03.04.2011
Help
T:\My Documents\Pilot\gamemodes\pilot2.pwn(315) : error 029: invalid expression, assumed zero
T:\My Documents\Pilot\gamemodes\pilot2.pwn(315) : error 017: undefined symbol "GiveScore"
T:\My Documents\Pilot\gamemodes\pilot2.pwn(316) : error 029: invalid expression, assumed zero
T:\My Documents\Pilot\gamemodes\pilot2.pwn(316) : error 017: undefined symbol "GiveScore"
T:\My Documents\Pilot\gamemodes\pilot2.pwn(31

: error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors.
Re: Timer Score -
Mmartin - 03.04.2011
What about lines?
Re: Timer Score -
[M.A]Angel[M.A] - 03.04.2011
Thanks i will try!
Re: Timer Score -
[M.A]Angel[M.A] - 03.04.2011
Quote:
Originally Posted by Clive
OnPlayerConnect:
pawn Код:
SetTimerEx("GiveScore", 60*1000, true, "i", playerid);
Somewhere in your script:
pawn Код:
forward GiveScore(playerid); public GiveScore(playerid) { SetPlayerScore(playerid, GetPlayerScore(playerid) + 1); }
|
>> Thanks best
>> But if i exit and come back score is removed :S
Re: Timer Score -
Mean - 03.04.2011
Quote:
Originally Posted by [M.A]Angel[M.A]
>> Thanks best
>> But if i exit and come back score is removed :S
|
You need to save the score to file:
pawn Код:
CMD:savemyscore( playerid, params[ ] ) {
new file[ 256 ], name[ 24 ]; GetPlayerName( playerid, name, 24 ); format( file, sizeof file, "somefolder/%s.ini", name );
new INI:PlayerAcc = INI_Open( file ); INI_WriteInt( PlayerAcc, "Score", GetPlayerScore( playerid ) ); INI_Close( PlayerAcc );
return SendClientMessage( playerid, 0xAAAAAA, "Your score has been saved to file" );
}
Saves your score to file^^. Uses Y_INI.
Re: Timer Score -
[M.A]Angel[M.A] - 03.04.2011
Is there another way eazly?
Re: Timer Score -
[M.A]Angel[M.A] - 04.04.2011
Quote:
Originally Posted by Mean
You need to save the score to file:
pawn Код:
CMD:savemyscore( playerid, params[ ] ) { new file[ 256 ], name[ 24 ]; GetPlayerName( playerid, name, 24 ); format( file, sizeof file, "somefolder/%s.ini", name ); new INI:PlayerAcc = INI_Open( file ); INI_WriteInt( PlayerAcc, "Score", GetPlayerScore( playerid ) ); INI_Close( PlayerAcc ); return SendClientMessage( playerid, 0xAAAAAA, "Your score has been saved to file" ); }
Saves your score to file^^. Uses Y_INI.
|
Success thanks, but OnPlayerConnect Load score how? ||| FIXED |||