Killing .. - 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: Killing .. (
/showthread.php?tid=250531)
Killing .. -
fie - 23.04.2011
Hello.
I have made teams.
I was just woundering how i could make, when England kills a German player the England guy gets +$1000
and the German player gets -$1000
Also the other way around.
Could you help me out? i have searched places but i cannot find.
I would be really greatful if you coud help.
Thanks!
Re: Killing .. -
Steven82 - 23.04.2011
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
GivePlayerMoney(killerid, 1000);
GiverPlayerMoney(playerid, -1000):
return 1;
}
Just use that code if you only have two teams. But problem with this is every time they die even if they kill their self they will still lose -1000.
Re: Killing .. -
judothijs - 23.04.2011
Code:
public OnPlayerDeath(playerid, killerid, reason)
{
if (GetPlayerTeam(killerid == TEAM_GERMAN && GetPlayerTeam(playerid == TEAM_ENGLAND))
{
GivePlayerMoney(killerid, 1000);
GivePlayerMoney(playerid, -1000);
return 1;
}
if (GetPlayerTeam(killerid == TEAM_ENGLAND && GetPlayerTeam(playerid == TEAM_GERMAN))
{
GivePlayerMoney(killerid, 1000);
GivePlayerMoney(playerid, -1000);
return 1;
}
Hope it helps