15.09.2012, 13:09
Hi!. First, my English is not very veryyy nice. So, be generous please, haha(:.
I have a Gamemode with a Cops Team and a Swat Team. The cops can kill anyone and the swat only 3+ wanted.
When the cops kills someone, he's not wanted and he win cash ; This is fine. But when the Swat kill someone, he win cash buut he's wanted. How can i do to fix that if i wanted the Swat never wanted ?, Thaaaaanx (:!.
Here's the code;
I have a Gamemode with a Cops Team and a Swat Team. The cops can kill anyone and the swat only 3+ wanted.
When the cops kills someone, he's not wanted and he win cash ; This is fine. But when the Swat kill someone, he win cash buut he's wanted. How can i do to fix that if i wanted the Swat never wanted ?, Thaaaaanx (:!.
Here's the code;
Код:
public OnPlayerDeath(playerid, killerid, reason) { if(killerid == INVALID_PLAYER_ID) { SendDeathMessage(INVALID_PLAYER_ID,playerid,reason); SetPlayerScore(killerid, GetPlayerMoney(killerid)); SetPlayerWantedLevel(killerid,0); } else { if(gTeam[killerid] == Swat) { if(gTeam[killerid] != gTeam[playerid]) { if(GetPlayerWantedLevel(playerid) > 3) { SendDeathMessage(killerid,playerid,reason); SendClientMessage(killerid,Jaune,"Bien, tu as tuй un criminel."); SetPlayerWantedLevel(killerid,0); GivePlayerMoney(killerid, GetPlayerWantedLevel(playerid)*100); SetPlayerWantedLevel(playerid,0); SetPlayerScore(killerid,GetPlayerMoney(killerid)); SetPlayerScore(playerid,GetPlayerMoney(playerid)); } else { SendDeathMessage(killerid,playerid,reason); SendClientMessage(killerid,Rouge,"Il n'est pas de ton calibre."); SetPlayerWantedLevel(killerid,0); GivePlayerMoney(killerid, -100); SetPlayerWantedLevel(playerid,0); SetPlayerScore(killerid,GetPlayerMoney(killerid)); SetPlayerScore(playerid,GetPlayerMoney(playerid)); } } else { SendClientMessage(killerid,Rouge,"Ne tue pas tes amis!"); SetPlayerWantedLevel(killerid,0); GivePlayerMoney(killerid,-400); SetPlayerScore(killerid,GetPlayerMoney(killerid)); SetPlayerScore(playerid,GetPlayerMoney(playerid)); } } { if(gTeam[killerid] == Cops) { if(gTeam[killerid] != gTeam[playerid]) { if(GetPlayerWantedLevel(playerid) <= 0) { SendDeathMessage(killerid,playerid,reason); SendClientMessage(killerid,Rouge,"Il n'est pas de ton calibre."); GivePlayerMoney(killerid, -100); SetPlayerWantedLevel(playerid,0); SetPlayerScore(killerid,GetPlayerMoney(killerid)); SetPlayerScore(playerid,GetPlayerMoney(playerid)); } else { SendDeathMessage(killerid,playerid,reason); SendClientMessage(killerid,Jaune,"Bien!, Tu as tuй un criminel."); GivePlayerMoney(killerid, GetPlayerWantedLevel(playerid)*100); SetPlayerWantedLevel(playerid,0); SetPlayerScore(killerid,GetPlayerMoney(killerid)); SetPlayerScore(playerid,GetPlayerMoney(playerid)); } } else { SendClientMessage(killerid,Rouge,"Ne tue pas tes amis!"); GivePlayerMoney(killerid,-400); SetPlayerScore(killerid,GetPlayerMoney(killerid)); SetPlayerScore(playerid,GetPlayerMoney(playerid)); } } } } if(gTeam[killerid] != Cops) { SendDeathMessage(killerid,playerid,reason); GivePlayerMoney(killerid, 100); SetPlayerScore(killerid,GetPlayerMoney(killerid)); SetPlayerWantedLevel(playerid,0); SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid) + 2); if(GetPlayerWantedLevel(killerid) >= 1) SetPlayerColor(killerid,Jaune); if(GetPlayerWantedLevel(killerid) >= 4) SetPlayerColor(killerid,Orange); SetPlayerScore(playerid,GetPlayerMoney(playerid)); } GameTextForPlayer(playerid, "Mort", 3500, 2); return 1; }