Help.. - 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: Help.. (
/showthread.php?tid=147734)
Help.. -
Lorenc_ - 14.05.2010
Hello I got this thing where every minute it sets your score +1.. heres the code.
OnGameModinit:
Код:
SetTimer("GiveScore",60000,1);
Somewhere around script:
Код:
public GiveScore(playerid)
{
SetPlayerScore(playerid,GetPlayerScore(playerid)+1);
GivePlayerMoney(playerid,10000);
InfoBoxForPlayer(playerid, "1 Minute passed! +1 Score and 10,000 earned.");
return 1;
}
Now i want it to Start to be like Pay day in usual rp servers. if you join when theres 20 seconds to go before 1 min is done it says You have not stayed long to obtain a point.
Re: Help.. -
[MWR]Blood - 14.05.2010
Quote:
if you join when theres 20 seconds to go before 1 min is done it says You have not stayed laong to obtain a point.
|
Didn't get that.
Re: Help.. -
Lorenc_ - 14.05.2010
Quote:
Originally Posted by ikarus❶❸❸❼
Quote:
if you join when theres 20 seconds to go before 1 min is done it says You have not stayed long to obtain a point.
|
Didn't get that.
|
Dont get it dont post it.
Re: Help.. -
alpha500delta - 14.05.2010
Quote:
Originally Posted by ikarus❶❸❸❼
Quote:
if you join the when theres 20 seconds to go before 1 min is done it says You have not stayed laong to obtain a point.
|
Didn't get that.
|
he probably means:
When you join the server when there are 20 seconds of the 1 minute timer left, the script says, you have not stayed long enough to get score. or something lol.
Re: Help.. -
Lorenc_ - 14.05.2010
Quote:
Originally Posted by alpha500delta
Quote:
Originally Posted by ikarus❶❸❸❼
Quote:
if you join when theres 20 seconds to go before 1 min is done it says You have not stayed laong to obtain a point.
|
Didn't get that.
|
he probably means: When you join when there are 20 seconds of the 1 minute timer left, the script says, you have not stayed long enough to get score. or something lol.
|
Yep! i'm just abit drunk and it makes me look like a person with no lecture lol.
Re: Help.. -
juice.j - 14.05.2010
Lots of ways:
One example:
Declare a variable storing the time a player connected. As soon as your function gets called it checks whether the player is already logged longer than the period of time you want them to be logged in before they get their paycheck.
I also doubt that your function works, seeing that you call it without parameters, alltough it expects a playerid to be passed. You might want to review that.
Re: Help.. -
Lorenc_ - 14.05.2010
Quote:
Originally Posted by juice.j
Lots of ways:
One example:
Declare a variable storing the time a player connected. As soon as your function gets called it checks whether the player is already logged longer than the period of time you want them to be logged in before they get their paycheck.
I also doubt that your function works, seeing that you call it without parameters, alltough it expects a playerid to be passed. You might want to review that.
|
It works... and btw can u show an example...
Re: Help.. -
Assyria - 14.05.2010
Maybe, ammmm.
Код:
SetTimer("Limit",20000,0);
new PayLimit[MAX_PLAYERS];
under OnPlayerConnet:
PayLimit[playerid] = 1;
Код:
public GiveScore(playerid)
{
if(PayLimit[playerid] == 1)
{
SetPlayerScore(playerid,GetPlayerScore(playerid)+1);
GivePlayerMoney(playerid,10000);
InfoBoxForPlayer(playerid, "1 Minute passed! +1 Score and 10,000 earned.");
}
else return SendClientMessage(playerid,color,"You haven't been online long enough to get payday");
return 1;
}
Код:
public Limit(playerid)
{
PayLimit = 0;
return 1;
}
Re: Help.. -
Lorenc_ - 14.05.2010
ok ill try it after.