[HELP] OnPlayerDeath - 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: [HELP] OnPlayerDeath (
/showthread.php?tid=276502)
[HELP] OnPlayerDeath -
Yaszine - 14.08.2011
Hi all
I have this script:
pawn Код:
new killer[MAX_PLAYER_NAME];
GetPlayerName(killerid, killer, sizeof(killer));
if (strlen(deathreason) > 0)
{
format(string, sizeof(string), "%s kills %s [%s] ",killer ,name ,deathreason);
if(DMArena[playerid]==1 && DMArena[killerid]==1)
{
GivePlayerMoney(killerid, 3000);
GivePlayerMoney(playerid, -3000);
if(AccInfo[killerid][LoggedIn] == 1)
{
new KScore;
KScore = GetPlayerScore(killerid);
SetPlayerScore(killerid, KScore +200);
}
else
{
}
if(AccInfo[playerid][LoggedIn] == 1)
{
new PScore;
PScore = GetPlayerScore(playerid);
SetPlayerScore(killerid, PScore +200);
}
}
else
{
}
}
else
{
format(string, sizeof(string), "%s kills %s", killer, name);
}
}
SendClientMessageToAll(RED, string);
{
}
But, when Player and Killer in DM .. the money/score system dont work
Can some one fix that, please
[I have the rest of this script, But this is where the problem is
]
Sorry for my bad English :$
Re: [HELP] OnPlayerDeath -
Backwardsman97 - 14.08.2011
pawn Код:
if(killerid != 255)
{
new killer[24];
GetPlayerName(killerid, killer, 24);
format(string, sizeof(string), "%s kills %s [%s] ",killer ,name ,deathreason);
if(DMArena[playerid] && DMArena[killerid])
{
GivePlayerMoney(killerid, 3000);
GivePlayerMoney(playerid, -3000);
if(AccInfo[killerid][LoggedIn])
{
new KScore;
KScore = GetPlayerScore(killerid);
SetPlayerScore(killerid, KScore +200);
}
if(AccInfo[playerid][LoggedIn] == 1)
{
new PScore;
PScore = GetPlayerScore(playerid);
SetPlayerScore(killerid, PScore +200);
}
}
}
I'm a little bit confused in parts. You add onto the killer's score if he's logged in and then again if the player is logged in? Also, I didn't understand the bottom at all so it's not included.
Re : [HELP] OnPlayerDeath -
Yaszine - 14.08.2011
Thanks for your help
When Killer kills another: +200pts to the killer and -200pts to the second peson
The same way for giving money
Loser -3000
Winner +3000
Re : [HELP] OnPlayerDeath -
Yaszine - 15.08.2011
@Backwardsman97: I had explain what I want
look up
Re: [HELP] OnPlayerDeath -
Backwardsman97 - 15.08.2011
Here try this.
pawn Код:
if(killerid != 255)
{
new killer[24];
GetPlayerName(killerid, killer, 24);
format(string, sizeof(string), "%s kills %s [%s] ",killer ,name ,deathreason);
if(DMArena[playerid] && DMArena[killerid])
{
GivePlayerMoney(killerid, 3000);
GivePlayerMoney(playerid, -3000);
if(AccInfo[killerid][LoggedIn])
SetPlayerScore(killerid, GetPlayerScore(killerid) + 200);
if(AccInfo[playerid][LoggedIn])
SetPlayerScore(killerid, GetPlayerScore(playerid) - 200);
}
}