Someone help with my DM server?
#1

I want to make it so that:
When a player dies a certain number of times, they get a weapon. I will be able to make them get the weapon, but I don't know how to make it so it counts their deaths.
Reply
#2

Put this with the rest of your "new"
pawn Код:
new deaths[MAX_PLAYERS];
This goes under OnPlayerDeath
pawn Код:
deaths[playerid] ++;
This goes under OnPlayerSpawn
pawn Код:
if(deaths[playerid] == 3)
{
//give the player any weapon you like.
deaths[playerid] = 0;
}
Reply
#3

Quote:
Originally Posted by Stah™
Put this with the rest of your "new"
pawn Код:
new deaths[MAX_PLAYERS];
This goes under OnPlayerDeath
pawn Код:
deaths[playerid] ++;
This goes under OnPlayerSpawn
pawn Код:
if(deaths[playerid] == 3)
{
//give the player any weapon you like.
deaths[playerid] = 0;
}
Thankyou for that, but could you help me once more? Make it so they can either do /deathreward, or wait until they have more deaths?
Reply
#4

Dont put this under OnPlayerDeath Then.
pawn Код:
if(deaths[playerid] == 3)
{
//give the player any weapon you like.
deaths[playerid] = 0;
}

Put this under OnPlayerDeath

pawn Код:
if(deaths[playerid] == 3)
{
//send a client message informing the player about his death reward.
}
Put this under OnPlayerCommandText.
pawn Код:
if(strcmp(cmdtext, "/deathreward", true) == 0)
{
  if(deaths[playerid] == 3)
  {
   // give him his wepons here
   deaths[playerid] = 0;
  }
}
Reply
#5

Yeah I fixed it myself, here's my code:
Код:
	if (strcmp("/getdeathreward", cmdtext, true) == 0)
	{
	if(deaths[playerid] == 2)
		{
			GivePlayerWeapon(playerid, 1, 1);
			SendClientMessage(playerid, COLOR_WHITE, "You have been given some brass knuckles as a death reward.");
			deaths[playerid] = 0;
		} else if(deaths[playerid] == 3) {
		  GivePlayerWeapon(playerid, 2, 1);
  			SendClientMessage(playerid, COLOR_WHITE, "You have been given a golf club as a death reward.");
 		  deaths[playerid] = 0;
		} else if(deaths[playerid] == 4) {
			GivePlayerWeapon(playerid, 3, 1);
			SendClientMessage(playerid, COLOR_WHITE, "You have been given a night stick as a death reward.");
			deaths[playerid] = 0;
		}
		return 1;
	}
	if (strcmp("/deathstreak", cmdtext, true) == 0)
	{
	new string[128];
	format(string, sizeof(string), "You have a deathstreak of %d deaths.", deaths[playerid]);
	SendClientMessage(playerid, COLOR_WHITE, string);
	return 1;
	}
Could you make it so that if you do /getdeathreward, it says "Are you sure you want to exchange your deathstreak for a reward?", and you have to type confirm to get the reward?
Reply
#6

Lol this is not help with DM server but DM server only
Reply
#7

Not really, I just want help with a command...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)