[HELP] war problem gangs - 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)
+--- Thread: [HELP] war problem gangs (
/showthread.php?tid=556458)
[HELP] war problem gangs -
Luca12 - 10.01.2015
Hello I have war for gangs and when they play wars gang 1 and gang 2 then if someone from gang 1 kill someone from gang 2 then it's okay but the problem is if leader of member of gang 1 kill someone in gang 1 how can I make something like
you kill your own member in wan you loose -1 point if you know what I mean. and that code go under onplayerdeath. Thanks
Re: [HELP] war problem gangs -
HY - 10.01.2015
Well... We cannot guess your code.
If you could give to us your enums about War System..
Well, you could do something like this.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(PlayerInfo[killerid][Leader] == PlayerInfo[playerid][Member])
{
SendClientMessage(playerid, -1, "You killed your own member in war. You lost 1 point.");
// Other functions here.
}
return 1;
}
Repeat. Replace that PlayerInfo functions with your real enums. I can't guess your code, but I gave to you an example.
Cheers.
Re: [HELP] war problem gangs -
Luca12 - 10.01.2015
How can in this code put if member from wartim1 kill another member of wartim1 then wartim2 get two points I try everything but it doesn't work the code is fine know when someone from wartim1 kill someone from wartim2 I just have a problem know when member kill leader in wartim1 or wartim2 that the same team get points if you know what I mean? Thanks
pawn Код:
if(PlayerInfo[killerid][Member] == WarTim1 || PlayerInfo[killerid][Leader] == WarTim1 || PlayerInfo[playerid][Member] == WarTim2 || PlayerInfo[playerid][Leader] == WarTim2)
{
if(killerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[killerid][Leader]) WarTim1Score += 2;
else WarTim1Score++;
}
if(killerid != INVALID_PLAYER_ID)
{
PlayerInfo[killerid][Kills]++;
}
PlayerInfo[playerid][Deaths]++;
if(PlayerInfo[killerid][Lider]) format(war,128,"(War) Leader %s kill player %s from war team 2.(+2 boda)",hWarName[0],hWarName[1]);
else format(war,128,"(War) Member %s is kill player %s from warteam2.(+1 bod)",hWarName[0],hWarName[1]);
WarMessage(0x800080FF,war);
}