04.09.2014, 08:09
Hello, I want to make a new score system something like:
2Hour of gameplay = 1 score
1kill=1score
1death= -1 score
Please help.
2Hour of gameplay = 1 score
1kill=1score
1death= -1 score
Please help.
//under OnGameModeInit SetTimer("gScore",3600000,1); //Anywhere (out of any callback) forward gScore(); public gScore() { foreach(Player,i) { SetPlayerScore(i,GetPlayerScore(i)+1); } return 1; } Not my code
public OnPlayerDeath(playerid, killerid, reason) { if(killerid != INVALID_PLAYER_ID) { PlayerData[killerid][Kills]++; } PlayerData[playerid][Deaths]++; gIsPlayerDead[playerid] = 1; return 1; } Need enum enum pData { Kills, Deaths, }; new PlayerData[MAX_PLAYERS][pData];
public OnPlayerDeath(playerid, killerid, reason)
{
// Add 1 to this killer's score. We must check it is valid first.
if(killerid != INVALID_PLAYER_ID)
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
return 1;
}
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
//under OnGameModeInit SetTimer("gScore",3600000,1); //Anywhere (out of any callback) forward gScore(); public gScore() { foreach(Player,i) { SetPlayerScore(i,GetPlayerScore(i)+1); } return 1; }
public OnPlayerDeath(playerid, killerid, reason) { if(killerid != INVALID_PLAYER_ID) { PlayerData[killerid][Kills]++; } PlayerData[playerid][Deaths]++; return 1; } Need enum enum pData { Kills, Deaths, }; new PlayerData[MAX_PLAYERS][pData];
public OnPlayerDeath(playerid, killerid, reason) { if(killerid != INVALID_PLAYER_ID) { SetPlayerScore(killerid, GetPlayerScore(killerid)+1); } SetPlayerScore(playerd, GetPlayerScore(playerd)-1); return 1; }