23.06.2014, 08:08
I Made The Killer Of The Day System,And After It's Timer Ends,It Suppose To Send Some Messages And Give Money And Score To The Killer Of The Day,But There is nothing working. At These Codes:
The Codes Of The Timer Under OnGameModeInit:
The Codes Of The Variable KillerScore[MAX_PLAYERS] Under OnPlayerDeath:
Please Help For REP.
pawn Код:
stock GetHighestKiller()
{
new m;
for(new i = 0 ; i <= MAX_PLAYERS ; i++)
{
if(KillerScore[i] > KillerScore[m])
{
m = i;
}
}
return 1;
}
forward KillingScore();
public KillingScore()
{
new highestkiller = GetHighestKiller();
new str[64];
if(highestkiller != INVALID_PLAYER_ID)
{
format(str, sizeof(str), "Congratulations!, You Are The {FF0000}Killer {FFEE00}Of The Day, Reward: $10000 Cash And 10 Scores!");
SendClientMessage(highestkiller, 0xFFEE00FF, str);
GivePlayerMoney(highestkiller, 10000);
SetPlayerScore(highestkiller, GetPlayerScore(highestkiller)+10);
GameTextForPlayer(highestkiller, "~g~Killer Of The Day! Reward: $10000 And 10 Scores!", 5000, 4);
foreach(Player, i)
{
format(str, sizeof(str), "%s Is The {FF0000}Killer {FFEE00}Of The Day, Congratulations! With: %d Kills Today!", highestkiller, KillerScore[highestkiller]);
SendClientMessage(highestkiller, 0x00FFF2FF, str);
KillerScore[i] = 0;
}
}
}
pawn Код:
SetTimer("KillingScore", 1380000, true);
pawn Код:
KillerScore[killerid] ++;