SA-MP Forums Archive
player kill cop score help - 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: player kill cop score help (/showthread.php?tid=152766)



player kill cop score help - Kar - 05.06.2010

ok i have 2 teams citizens and police

i wanna make it like if a citizens kill a police he gains 1+ score
Код:
if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 5 || classid == 6 || classid == 7 || classid == 8 || classid == 9 || classid == 10 || classid == 11 || classid == 12)
	{
	SetPlayerTeam(playerid,1);
	GameTextForPlayer(playerid,"~b~Police",5000,1);
	}
	else
	{
	SetPlayerTeam(playerid,2);
	GameTextForPlayer(playerid,"~w~Citizen",5000,1);
	}



Re: player kill cop score help - jameskmonger - 05.06.2010

pawn Код:
public OnPlayerDeath(playerid, killerid, reason) {
     if(GetPlayerTeam(playerid) == 1 && GetPlayerTeam(killerid) == 2) {
         //score stuff here
     }
}



Re: player kill cop score help - Kar - 05.06.2010

i need a tester to see if it works now<.<

69.73.201.245:7777


Re: player kill cop score help - DJDhan - 05.06.2010

Код:
public OnPlayerDeath(playerid, killerid, reason) 
{
     if(GetPlayerTeam(playerid) == 1 && GetPlayerTeam(killerid) == 2) 
    {
      SetPlayerScore(killerid,GetPlayerScore(kilerid)+1);  
    }

    return 1;
}



Re: player kill cop score help - Kar - 05.06.2010

kk come bac on i added urs