I want it so that when a player is in the /minigundm (if he kils someone in this minigun deathmatch) that it sends the killer a game text saying something like “You Killed %s”
Of coarse, I want the “%s” to say the players name who he killed… |
new PlayerName[MAX_PLAYERS]; //Somewhere at the top of the script, to save for the other bits later
GetPlayerName(playerid, PlayerName[playerid], 128); //In the /minigundm, or earlier (like OnPlayerSpawn)
new DeathMessage[128];
format(DeathMessage, sizeof(DeathMessage), "You Killed %s", PlayerName[playerid]); //In the OnPlayerDeath section?
SendClientMessage(killerid, A_COLOUR, DeathMessage);
Also, I want it so that if the killer kills 5 people in a row, that his name gets changed from “whatever_tester” to “[5-Kill-Streak]whatever_tester” |
new NewPlayerName[MAX_PLAYERS];
new KillStreak[MAX_PLAYERS];
format(NewPlayerName[playerid], 64, "[%s-kill-streak]%s", KillStreak[playerid], PlayerName[playerid]);
SetPlayerName(playerid, NewPlayerName);
public OnPlayerDeath(playerid, killerid, reason)
{
KillStreak[playerid] + 1;
}
But the catch is, I want the players name to lose the “[Kill-Streak]” once the player dies. |
SetPlayerName(playerid, PlayerName[playerid]);
Also, if there is a way, I would like the kill streak person to have their name auto changed to how many kills he has done. So if he killed 8 ppl it wold say “[8-Kill-Streak]whatever_tester” |
SetTimerEx("CheckKillStreak", 10000, true, "i", playerid);
forward CheckKillStreak(playerid);
public CheckKillStreak(playerid)
{
format(NewPlayerName[playerid], 128, "[%s-kill-streak]%s", KillStreak[playerid], PlayerName[playerid])
SetPlayerName(playerid, NewPlayerName[playerid]);
}
And lastly, I want the player and the killer to lose and gain random amounts of cash for each murder and death within the dm. |
public OnPlayerDeath(playerid, killerid, reason)
{
new randcash = random(250); //Max cash to give, change if needed
GivePlayerMoney(playerid, -randcash);
GivePlayerMoney(playerid, randcash);
}
new KillStreak[MAX_PLAYERS];
//under OnPlayerDeath
KillStreak[killerid] ++;
KillStreak[playerid] = 0;
if(KillStreak[killerid] == 5)
{
//What happens if killerid get a 5 killstreak without dying?
}
else if(KillStreak[killerid] == 8)
{
//What happens if killerid get a 8 killstreak without dying?
}