SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 12/08/2010, 08:03 PM   #1
Kevin_Joshen
Huge Clucker
 
Kevin_Joshen's Avatar
 
Join Date: Jul 2010
Posts: 321
Reputation: 0
Default name tag add ons + more features?

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
__________________


Check out the Forums!



Banner made by Zh3R0
Kevin_Joshen is offline  
Old 13/08/2010, 08:36 AM   #2
Ash.
High-roller
 
Ash.'s Avatar
 
Join Date: Jan 2010
Location: England
Posts: 2,140
Reputation: 160
Lightbulb Re: name tag add ons + more features?

Quote:
Originally Posted by Kevin_Joshen View Post
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 Code:
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 Code:
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 Code:
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 Code:
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 Code:
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
__________________
(AKA funky1234)

There are infinite possibilities


Think twice before you start programming or you will program twice before you start thinking.
Ash. is offline  
Old 13/08/2010, 09:14 AM   #3
[NWA]Hannes
Huge Clucker
 
[NWA]Hannes's Avatar
 
Join Date: Jul 2010
Location: Oxelösund, Sweden
Posts: 324
Reputation: 12
Default Re: name tag add ons + more features?

Killstreak is pretty easy.

pawn Code:
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?
}
__________________
Mostly inactive.

My old account is bajskorv123. (Now I have a low post count)
[NWA]Hannes is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What Map or Features Would You Like to See On The Next GTA? [HLF]Southclaw Everything and Nothing 31 23/05/2010 10:50 PM
Odd bug with the SA-MP GUi features. Elorreli Client Support 3 10/02/2010 09:53 PM
Help! About 0.3 Features.. [TR]Driftking Help Archive 2 19/12/2009 07:49 PM
[0.3] The Sexy New Features Rac3r Screenshots and Videos 7 20/09/2009 07:34 AM
0.3 features lockdown now, can someone summarize the new features? yezizhu Help Archive 12 20/09/2009 05:47 AM


All times are GMT. The time now is 08:02 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.