20.01.2011, 18:20
I can I make it that a person earns 5 points for every minute they are on the server??
thanks!
thanks!
public GivePoints()
{
for(new i; i=0; i <MAX_PLAYERS; i++)
{
SetPlayerScore(i,+5);
}
return 1;
}
new PlayerPoint[MAX_PLAYERS];
public OnGameModeInit()
{
SetTimer("Add5Points", 5000, true);
return 1;
}
forward Add5Points();
public Add5Points()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayerPoint[i] += 5;
}
}
return 1;
}
public OnGameModeInit()
{
SetTimer("Add5Points", 5000, true);
return 1;
}
forward Add5Points();
public Add5Points()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetPlayerScore(i, GetPlayerScore(i)+5);
}
}
return 1;
}
OnPlayerConnect
SetTimer("GivePoints",60000,true); pawn Код:
|
//under OnPlayerconnect
timerDaily[playerid] = SetTimerEx ("dailyScore", 60000, true, "d", playerid);
//under OnPlayerDisconnect
KillTimer(timerDaily[playerid]);
//bottom of the script
forward dailyScore (playerid);
public dailyScore (playerid)
{
SetPlayerScore (playerid, GetPlayerScore(playerid) + 5);
return 1;
}