PDA

View Full Version : Need help, for scripting a Gamemode ( Wanted Killing )


james3920
15/09/2012, 02:09 PM
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;


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;
}

james3920
15/09/2012, 02:11 PM
..( Here's the same, but in English -- ' )

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,Yellow,"Good, you catched a criminal.");
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,Red,"He's too weak for you.");
SetPlayerWantedLevel(killerid,0);
GivePlayerMoney(killerid, -100);
SetPlayerWantedLevel(playerid,0);
SetPlayerScore(killerid,GetPlayerMoney(killerid));
SetPlayerScore(playerid,GetPlayerMoney(playerid));
}
}
else
{
SendClientMessage(killerid,Red,"Don't kill your friends.");
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,Red,"Hes too weak.");
GivePlayerMoney(killerid, -100);
SetPlayerWantedLevel(playerid,0);
SetPlayerScore(killerid,GetPlayerMoney(killerid));
SetPlayerScore(playerid,GetPlayerMoney(playerid));
}
else
{
SendDeathMessage(killerid,playerid,reason);
SendClientMessage(killerid,Yellow,"Nice you catched a criminal");
GivePlayerMoney(killerid, GetPlayerWantedLevel(playerid)*100);
SetPlayerWantedLevel(playerid,0);
SetPlayerScore(killerid,GetPlayerMoney(killerid));
SetPlayerScore(playerid,GetPlayerMoney(playerid));
}
}
else
{
SendClientMessage(killerid,Red,"Dont kill your friend");
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,Yellow);
if(GetPlayerWantedLevel(killerid) >= 4) SetPlayerColor(killerid,Orange);
SetPlayerScore(playerid,GetPlayerMoney(playerid));
}
GameTextForPlayer(playerid, "Wasted", 3500, 2);
return 1;
}