08.11.2009, 16:02
Something weird with this. It should say the message according to the every 5 kills. But it will say it 5 times before it switches to the other one. Also since this the kills on the kill list are showing except for the Suicide picture. The Code:
EDIT: Yet in my test server it worked fine with me and 1 other person testing.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
KILLINGSPREE[killerid]++;
if(KILLINGSPREE[killerid] >= 5)
{
new string [128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(killerid, pName, sizeof(pName));
format(string, sizeof(string), "%s is on a killing spree!", pName);
GameTextForAll(string, 5000, 1);
PlayerPlaySound(killerid, 1062, -1370.2362, -256.3250, 14.1440);
SetTimerEx("MUSICTIMER",8000,1, "i", killerid);
}
if(KILLINGSPREE[killerid] >= 10)
{
new string [128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(killerid, pName, sizeof(pName));
format(string, sizeof(string), "~b~%s is dominating!", pName);
GameTextForAll(string, 5000, 1);
PlayerPlaySound(killerid, 1062, -1370.2362, -256.3250, 14.1440);
SetTimerEx("MUSICTIMER",8000,1, "i", killerid);
}
if(KILLINGSPREE[killerid] >= 15)
{
new string [128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(killerid, pName, sizeof(pName));
format(string, sizeof(string), "~g~%s is dominating!", pName);
GameTextForAll(string, 5000, 1);
PlayerPlaySound(killerid, 1062, -1370.2362, -256.3250, 14.1440);
SetTimerEx("MUSICTIMER",8000,1, "i", killerid);
}
if(KILLINGSPREE[killerid] >= 20)
{
new string [128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(killerid, pName, sizeof(pName));
format(string, sizeof(string), "~g~%s is ~u~God like!~u~", pName);
GameTextForAll(string, 5000, 1);
PlayerPlaySound(killerid, 1097, -1370.2362, -256.3250, 14.1440);
SetTimerEx("MUSICTIMER",8000,1, "i", killerid);
}
if(PlayerIsInDM[playerid] == true)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You haved died in a deathmatch and your random spawning has been disabled.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Type /random to re enable it");
RANDOM[playerid] = false;
}
if(PlayerIsInDM[playerid] == false)
{
RANDOM[playerid] = true;
}
if(killerid != INVALID_PLAYER_ID)
{
GivePlayerMoney(killerid, GetPlayerMoney(killerid) + 50);
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
KILLINGSPREE[playerid] = 0;
SetPlayerWantedLevel(playerid, 0);
SendDeathMessage(killerid, playerid, reason);
return 1;
}