SA-MP Forums Archive
name tag add ons + more features? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: name tag add ons + more features? (/showthread.php?tid=167556)



name tag add ons + more features? - Kevin_Joshen - 12.08.2010

Can you all help me with this?


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…

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”

But the catch is, I want the players name to lose the “[Kill-Streak]” once the player dies.

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”


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.

Is this all possible to be just in this dm command area?

Thanks!
-Kevin


Re: name tag add ons + more features? - Ash. - 13.08.2010

Quote:
Originally Posted by Kevin_Joshen
Посмотреть сообщение
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…
pawn Код:
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);
Quote:

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”

pawn Код:
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;
}
Quote:

But the catch is, I want the players name to lose the “[Kill-Streak]” once the player dies.

pawn Код:
SetPlayerName(playerid, PlayerName[playerid]);
Quote:

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”

I have been thinking about this one for a while...
pawn Код:
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]);
}
Quote:

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.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
     new randcash = random(250); //Max cash to give, change if needed
     GivePlayerMoney(playerid, -randcash);
     GivePlayerMoney(playerid, randcash);
}
I havent tested any of the above code, but it has been thought through quite a bit! - If anyone has a better code, or can correct me, go ahead

Thanks
Ash


Re: name tag add ons + more features? - [NWA]Hannes - 13.08.2010

Killstreak is pretty easy.

pawn Код:
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?
}