OnPlayerDeath [Taken down]
#1

Hello I wan't If the police killed a player with Wanted Level +4 Put him InJail

PHP код:
else if(SWAT(GetPlayerSkin(playerid)))
            {
                
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
                
SetPlayerScore(playeridGetPlayerScore(playerid)-1);
                
format(stringsizeof(string), "{E6FD00}%s[%d] has been {00E6FD}Taken Down {ffffff}by {00FFFF}S.W.A.T Special Forces {308AFF}%s(%d)!"tName,targetid,pName,playerid);
                
SendClientMessageToAll(-1,string);
                
format(stringsizeof(string), "~b~Taken Down ~W~%s(%d)"tNametargetid);
                
GameTextForPlayer(playeridstring70005);
                new 
Randomm random(sizeof(RandommJailSpawns));
                
SetPlayerPos(targetidRandommJailSpawns[Randomm][0], RandommJailSpawns[Randomm][1], RandommJailSpawns[Randomm][2]);
                
SetPlayerFacingAngle(targetidRandommJailSpawns[Randomm][2]);
                
SetPlayerInterior(targetid3);
                
pJailTimerID[targetid] = SetTimerEx("pJailTimer"1000true"i"targetid);
                
pJailCount[targetid] = 80 random(100);
                
ResetPlayerWeapons(targetid);
                
SetPlayerColor(targetidCOLOR_WHITE);
                
SetPlayerWantedLevel(targetid,0);
                
SetPlayerHealth(targetid5000000);
                return 
1;
            } 
But It's not worked anymore why? I've trying to taken down my friend but It's sayed by OFFICER not by SWAT why?
Reply
#2

Can u post all code with all conditions
Reply
#3

as you wish.

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    new 
pName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME],targetid,string[128];
    if(!
PoliceTeam(GetPlayerSkin(playerid)))
    {
        if(
GetPlayerWantedLevel(playerid) == 0)
        {
            
SetPlayerScore(killeridGetPlayerScore(killerid)-1);
            
SendClientMessage(killeridWHITE"{FD4800}Warring: {FFFFFF}DON'T KILL innocent players! Read /pc & /rules!");
            
GivePlayerCash(killerid, -5000);
            
PlayerInfo[killerid][aKills] ++;
            
PlayerInfo[killerid][aDeaths] ++;
            
SetPlayerScore(killeridGetPlayerScore(killerid)-1);
            return 
1;
        }
        else if(
GetPlayerWantedLevel(playerid) <= && GetPlayerWantedLevel(playerid)>= 1)
        {
            
SetPlayerScore(killeridGetPlayerScore(killerid)-1);
            
SendClientMessage(killeridWHITE"{FD4800}Warring: {FFFFFF}DON'T KILL innocent players! Read /pc & /rules!");
            
GivePlayerCash(killerid, -5000);
            
PlayerInfo[killerid][aKills] ++;
            
PlayerInfo[killerid][aDeaths] ++;
            
SetPlayerScore(killeridGetPlayerScore(killerid)-1);
            return 
1;
        }
        else if(
GetPlayerWantedLevel(playerid) <= && GetPlayerWantedLevel(playerid) >= 30)
        {
              if(
PoliceTeam(GetPlayerSkin(playerid)))
            {
                
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
                
SetPlayerScore(playeridGetPlayerScore(playerid)-1);
                
format(stringsizeof(string), "{E6FD00}%s[%d] has been {00E6FD}Taken Down {ffffff}by Officer %s[%d]!"tName,targetid,pName,playerid);
                
SendClientMessageToAll(-1,string);
                
                
format(stringsizeof(string), "~b~Taken Down ~W~%s(%d)"tNametargetid);
                
GameTextForPlayer(playeridstring70005);
                
                new 
Randomm random(sizeof(RandommJailSpawns));
                
SetPlayerPos(targetidRandommJailSpawns[Randomm][0], RandommJailSpawns[Randomm][1], RandommJailSpawns[Randomm][2]);
                
SetPlayerFacingAngle(targetidRandommJailSpawns[Randomm][2]);
                
SetPlayerInterior(targetid3);
                
pJailTimerID[targetid] = SetTimerEx("pJailTimer"1000true"i"targetid);
                
pJailCount[targetid] = 80 random(100);
                
ResetPlayerWeapons(targetid);
                
SetPlayerColor(targetidCOLOR_WHITE);
                
SetPlayerWantedLevel(targetid,0);
                
SetPlayerHealth(targetid5000000);
                return 
1;
            }
            else if(
SWAT(GetPlayerSkin(playerid)))
            {
                
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
                
SetPlayerScore(playeridGetPlayerScore(playerid)-1);
                
format(stringsizeof(string), "{E6FD00}%s[%d] has been {00E6FD}Taken Down {ffffff}by {00FFFF}S.W.A.T Special Forces {308AFF}%s(%d)!"tName,targetid,pName,playerid);
                
SendClientMessageToAll(-1,string);
                
format(stringsizeof(string), "~b~Taken Down ~W~%s(%d)"tNametargetid);
                
GameTextForPlayer(playeridstring70005);
                new 
Randomm random(sizeof(RandommJailSpawns));
                
SetPlayerPos(targetidRandommJailSpawns[Randomm][0], RandommJailSpawns[Randomm][1], RandommJailSpawns[Randomm][2]);
                
SetPlayerFacingAngle(targetidRandommJailSpawns[Randomm][2]);
                
SetPlayerInterior(targetid3);
                
pJailTimerID[targetid] = SetTimerEx("pJailTimer"1000true"i"targetid);
                
pJailCount[targetid] = 80 random(100);
                
ResetPlayerWeapons(targetid);
                
SetPlayerColor(targetidCOLOR_WHITE);
                
SetPlayerWantedLevel(targetid,0);
                
SetPlayerHealth(targetid5000000);
                return 
1;
            }
            else if(!
Army(GetPlayerSkin(playerid)))
            {
                
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
                
SetPlayerScore(playeridGetPlayerScore(playerid)-1);
                
format(stringsizeof(string), "{E6FD00}%s[%d] has been {00E6FD}Taken Down {ffffff}by {932EE7}San Andreas Army {308AFF}%s(%d)!"tName,targetid,pName,playerid);
                
SendClientMessageToAll(-1,string);
                
format(stringsizeof(string), "~p~Taken Down ~W~%s(%d)"tNametargetid);
                
GameTextForPlayer(playeridstring70005);
                new 
Randomm random(sizeof(RandommJailSpawns));
                
SetPlayerPos(targetidRandommJailSpawns[Randomm][0], RandommJailSpawns[Randomm][1], RandommJailSpawns[Randomm][2]);
                
SetPlayerFacingAngle(targetidRandommJailSpawns[Randomm][2]);
                
SetPlayerInterior(targetid3);
                
pJailTimerID[targetid] = SetTimerEx("pJailTimer"1000true"i"targetid);
                
pJailCount[targetid] = 80 random(100);
                
ResetPlayerWeapons(targetid);
                
SetPlayerColor(targetidCOLOR_WHITE);
                
SetPlayerWantedLevel(targetid,0);
                
SetPlayerHealth(targetid5000000);
                return 
1;
            }
            else if(!
CIA(GetPlayerSkin(playerid)))
            {
                
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
                
SetPlayerScore(playeridGetPlayerScore(playerid)-1);
                
format(stringsizeof(string), "{E6FD00}%s[%d] has been {00E6FD}Taken Down {ffffff}by {FFFFFF}Central Intelligence Agency {308AFF}%s(%d)!"tName,targetid,pName,playerid);
                
SendClientMessageToAll(-1,string);
                
format(stringsizeof(string), "~p~Taken Down ~W~%s(%d)"tNametargetid);
                
GameTextForPlayer(playeridstring70005);
                new 
Randomm random(sizeof(RandommJailSpawns));
                
SetPlayerPos(targetidRandommJailSpawns[Randomm][0], RandommJailSpawns[Randomm][1], RandommJailSpawns[Randomm][2]);
                
SetPlayerFacingAngle(targetidRandommJailSpawns[Randomm][2]);
                
SetPlayerInterior(targetid3);
                
pJailTimerID[targetid] = SetTimerEx("pJailTimer"1000true"i"targetid);
                
pJailCount[targetid] = 80 random(100);
                
ResetPlayerWeapons(targetid);
                
SetPlayerColor(targetidCOLOR_WHITE);
                
SetPlayerWantedLevel(targetid,0);
                
SetPlayerHealth(targetid5000000);
                return 
1;
            }
            else if(!
FBII(GetPlayerSkin(playerid)))
            {
                
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
                
SetPlayerScore(playeridGetPlayerScore(playerid)-1);
                
format(stringsizeof(string), "{E6FD00}%s[%d] has been {00E6FD}Taken Down {ffffff}by {308AFF}Federal Agent {308AFF}%s(%d)!"tName,targetid,pName,playerid);
                
SendClientMessageToAll(-1,string);
                
format(stringsizeof(string), "~p~Taken Down ~W~%s(%d)"tNametargetid);
                
GameTextForPlayer(playeridstring70005);
                new 
Randomm random(sizeof(RandommJailSpawns));
                
SetPlayerPos(targetidRandommJailSpawns[Randomm][0], RandommJailSpawns[Randomm][1], RandommJailSpawns[Randomm][2]);
                
SetPlayerFacingAngle(targetidRandommJailSpawns[Randomm][2]);
                
SetPlayerInterior(targetid3);
                
pJailTimerID[targetid] = SetTimerEx("pJailTimer"1000true"i"targetid);
                
pJailCount[targetid] = 80 random(100);
                
ResetPlayerWeapons(targetid);
                
SetPlayerColor(targetidCOLOR_WHITE);
                
SetPlayerWantedLevel(targetid,0);
                
SetPlayerHealth(targetid5000000);
                return 
1;
            }
        }
    }
      return 
1;

Reply
#4

any help?
Reply
#5

[QUOTE=Thanks;4018581]Hello I wan't If the police killed a player with Wanted Level +4 Put him InJail

PHP код:
else if(SWAT(GetPlayerSkin(playerid)))
            {
                
                
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
                
SetPlayerScore(playeridGetPlayerScore(playerid)-1);
                
format(stringsizeof(string), "{E6FD00}%s[%d] has been {00E6FD}Taken Down {ffffff}by {00FFFF}S.W.A.T Special Forces {308AFF}%s(%d)!"tName,targetid,pName,playerid);
                
SendClientMessageToAll(-1,string);
                
format(stringsizeof(string), "~b~Taken Down ~W~%s(%d)"tNametargetid);
                
GameTextForPlayer(playeridstring70005);
               if(
GetPlayerWantedLevel(playerid) >= 4)
               {
                new 
Randomm random(sizeof(RandommJailSpawns));
                
SetPlayerPos(targetidRandommJailSpawns[Randomm][0], RandommJailSpawns[Randomm][1], RandommJailSpawns[Randomm][2]);
                
SetPlayerFacingAngle(targetidRandommJailSpawns[Randomm][2]);
                
SetPlayerInterior(targetid3);
                
pJailTimerID[targetid] = SetTimerEx("pJailTimer"1000true"i"targetid);
                
pJailCount[targetid] = 80 random(100);
                
ResetPlayerWeapons(targetid);
                
SetPlayerColor(targetidCOLOR_WHITE);
                
SetPlayerWantedLevel(targetid,0);
                
SetPlayerHealth(targetid5000000);
                }
                return 
1;
            } 
try this
Reply
#6

Still not work dude...
Reply
#7

Код:
else if(SWAT(GetPlayerSkin(playerid)))
This line post SWAT
Reply
#8

PHP код:
stock SWAT(skinid)
{
    switch(
skinid)
    {
        case 
285: return 1;
        default: return 
0;
    }
    return 
0;

This?
Reply
#9

Quote:
Originally Posted by Thanks
Посмотреть сообщение
PHP код:
stock SWAT(skinid)
{
    switch(
skinid)
    {
        case 
285: return 1;
        default: return 
0;
    }
    return 
0;

This?
Yes also post policeteam please
Reply
#10

PHP код:
stock PoliceTeam(skinid)
{
    
// includes corrupt cops from singleplayer, SWAT, FBI and Army skin and 0.3.7 cop ones
    
switch(skinid)
    {
        case 
265..267280..288300..302306307309..311: return 1;
        default: return 
0;
    }
    return 
0;
}
stock ArmyTeam(skinid)
{
   switch(
skinid)
   {
     case 
287: return 1;
     default: return 
0;
   }
   return 
0;
}
stock SWAT(skinid)
{
  switch(
skinid)
  {
     case 
285: return 1;
     default: return 
0;
  }
  return 
0;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)