Jump to content
  • 0

Problema finctie


DeLeT.

Question

Problema intalnita (descriere): Dupa ce omor playerul cu wanted imi da mie wanted iar eu sunt in factiunea police
Ero(area / rile) / warning-(ul / urile):  warning 213: tag mismatch
Liniile de cod / sursa / script-ul(obligatoriu):

public OnPlayerDeath(playerid, killerid, reason)
{
    new oldlevel;
     new newlevel;
      oldlevel = GetPlayerWantedLevel(killerid);
       newlevel = oldlevel + 1;

    if(gTeam[killerid] != TEAM_COPS) {  // Change TEAM_COPS with the name of cop team of your gamemode
    SetPlayerWantedLevel(killerid, newlevel);
    SetPlayerWantedLevel(playerid, 0);
    SendClientMessage(killerid, COLOR_BRIGHTRED,"Your wanted level is increased!"); }

    else if(GetPlayerWantedLevel(playerid) == 1)   {
    if(gTeam[killerid] != P_Data[playerid][pMember] == 1){  // Change TEAM_COPS with the name of cop team of your gamemode
    GivePlayerMoney(killerid,1000);
     SetPlayerWantedLevel(playerid, 0);
    SendClientMessage(killerid, COLOR_COP,"You killed a criminal and earned 1000$!");}
    } else if(GetPlayerWantedLevel(playerid) == 2)   {
    if(gTeam[killerid] == TEAM_COPS){  // Change TEAM_COPS with the name of cop team of your gamemode
    GivePlayerMoney(killerid,2000);
      SetPlayerWantedLevel(playerid, 0);
    SendClientMessage(killerid, COLOR_COP,"You killed a criminal and earned 2000$!");}
    } else if(GetPlayerWantedLevel(killerid) == 3)   {
    if(gTeam[killerid] == TEAM_COPS){  // Change TEAM_COPS with the name of cop team of your gamemode
    GivePlayerMoney(killerid,3000);
      SetPlayerWantedLevel(playerid, 0);
    SendClientMessage(killerid, COLOR_COP,"You killed a criminal and earned 3000$!");}
    } else if(GetPlayerWantedLevel(killerid) == 4)   {
    if(gTeam[killerid] == TEAM_COPS){  // Change TEAM_COPS with the name of cop team of your gamemode
    GivePlayerMoney(killerid,4000);
      SetPlayerWantedLevel(playerid, 0);
    SendClientMessage(killerid, COLOR_COP,"You killed a criminal and earned 4000$!");}
    } else if(GetPlayerWantedLevel(killerid) == 5)   {
    if(gTeam[killerid] == TEAM_COPS){  // Change TEAM_COPS with the name of cop team of your gamemode
    GivePlayerMoney(killerid,5000);
      SetPlayerWantedLevel(playerid, 0);
    SendClientMessage(killerid, COLOR_COP,"You killed a criminal and earned 5000$!");}
    } else if(GetPlayerWantedLevel(killerid) == 6)   {
    if(gTeam[killerid] == TEAM_COPS){  // Change TEAM_COPS with the name of cop team of your gamemode
    GivePlayerMoney(killerid,6000);
      SetPlayerWantedLevel(playerid, 0);
    SendClientMessage(killerid, COLOR_COP,"You killed a criminal and earned 6000$!");}
    }
    return 1;
}

Ati incercat sa rezolvati singur?: Am incercat sa adaug    if(gTeam[killerid] != P_Data[playerid][pMember] == 1) cum il am eu in game mode, denumita factiunea  COP

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0
public OnPlayerDeath(playerid, killerid, reason)
{
    new oldlevel;
     new newlevel;
      oldlevel = GetPlayerWantedLevel(killerid);
       newlevel = oldlevel + 1;

    if(P_Data[killerid][pMember] != 1) { 
        SetPlayerWantedLevel(killerid, newlevel);
        SendClientMessage(killerid, COLOR_BRIGHTRED,"Your wanted level is increased!"); 
    }
    else
    {
        if(GetPlayerWantedLevel(playerid) != 0)   {
            new moneyAmount = 1000 * GetPlayerWantedLevel(playerid), stringCop[128];
            GivePlayerMoney(killerid,moneyAmount);
            SetPlayerWantedLevel(playerid, 0);
            format(stringCop, 128, "You've killed a criminal and earned $%i", moneyAmount); 
            SendClientMessage(killerid, COLOR_COP, stringCop[128]);
        }
    }
    return 1;
}

Înceacă așa.

Link to comment
Share on other sites

  • 0

Deci, nu prea am înțeles ce vrei să facă script-ul. Să înțeleg că atunci când un player omoară pe cineva și nu e polițist să îi dea wanted, iar când e polițist să îl bage pe player-ul omorât la închisoare dacă are wanted. Am dreptate?

Link to comment
Share on other sites

  • 0
public OnPlayerDeath(playerid, killerid, reason)
{
    new oldlevel;
     new newlevel;
      oldlevel = GetPlayerWantedLevel(killerid);
       newlevel = oldlevel + 1;

    if(P_Data[killerid][pMember] != 1) { 
        SetPlayerWantedLevel(killerid, newlevel);
        SetPlayerWantedLevel(playerid, 0);
        SendClientMessage(killerid, COLOR_BRIGHTRED,"Your wanted level is increased!"); 
    }
    else
    {
        if(GetPlayerWantedLevel(playerid) != 0)   {
            new moneyAmount = 1000 * GetPlayerWantedLevel(playerid), stringCop[128];
            GivePlayerMoney(killerid,moneyAmount);
            SetPlayerWantedLevel(playerid, 0);
            format(stringCop, 128, "You've killed a criminal and earned $%i", moneyAmount); 
            SendClientMessage(killerid, COLOR_COP, stringCop[128]);
        }
    }
    return 1;
}

 

 

Link to comment
Share on other sites

  • 0
public OnPlayerDeath(playerid, killerid, reason)
{
    new oldlevel;
     new newlevel;
      oldlevel = GetPlayerWantedLevel(killerid);
       newlevel = oldlevel + 1;
    new plFaction = P_Data[killerid][pMember] + P_Data[killerid][pLeader];
    if(plFaction != 1) { 
        SetPlayerWantedLevel(killerid, newlevel);
        SendClientMessage(killerid, COLOR_BRIGHTRED,"Your wanted level is increased!"); 
    }
    else
    {
        if(GetPlayerWantedLevel(playerid) != 0)   {
            new moneyAmount = 1000 * GetPlayerWantedLevel(playerid), stringCop[128];
            GivePlayerMoney(killerid,moneyAmount);
            SetPlayerWantedLevel(playerid, 0);
            format(stringCop, 128, "You've killed a criminal and earned $%i", moneyAmount); 
            SendClientMessage(killerid, COLOR_COP, stringCop[128]);
        }
    }
    return 1;
}

Încearcă așa, probabil erai lider.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.