Someone help with my DM server? - 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: Someone help with my DM server? (
/showthread.php?tid=120820)
Someone help with my DM server? -
jameskmonger - 13.01.2010
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.
Re: Someone help with my DM server? -
Stah - 13.01.2010
Put this with the rest of your "new"
This goes under OnPlayerDeath
This goes under OnPlayerSpawn
pawn Код:
if(deaths[playerid] == 3)
{
//give the player any weapon you like.
deaths[playerid] = 0;
}
Re: Someone help with my DM server? -
jameskmonger - 13.01.2010
Quote:
Originally Posted by Stah™
Put this with the rest of your "new"
This goes under OnPlayerDeath
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?
Re: Someone help with my DM server? -
Stah - 13.01.2010
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;
}
}
Re: Someone help with my DM server? -
jameskmonger - 13.01.2010
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?
Re: Someone help with my DM server? -
Kurence - 13.01.2010
Lol this is not help with DM server but DM server only
Re: Someone help with my DM server? -
jameskmonger - 13.01.2010
Not really, I just want help with a command...