Help..
#1

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

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

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

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

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

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

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

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

ok ill try it after.
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)