Jump to content

Question

Posted

Salut , am o problema si nu inteleg unde.Cand dau /free pe server imi spune ca acest playeri nu este la jail,sau nu are nevoie de avocat.

[pawn]CMD:free(playerid, params [])

{

  new string[128], playerto, sendername[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];

  if(PlayerInfo[playerid][pJob] != 2)

  {

        SendClientMessage(playerid, COLOR_GREY, "Nu esti avocat!");

        return 1;

  }

  if(PlayerInfo[playerid][pLawSkill] >= 401)

  {

        ApprovedLawyer[playerid] = 1;

  }

  if(sscanf(params, "u", playerto)) return SendClientMessage(playerid, COLOR_ORANGE, "{F97804}USAGE:{B4B5B7}{FFFFFF} /free [playerid/PartOfName]");

  if(!IsPlayerConnected(playerto)) return SendClientMessage(playerid, COLOR_GRAD1,"Invalid player !");

                    if(playerto == playerid) { SendClientMessage(playerid, COLOR_GRAD1, "Nu-ti poti acorda /free singur."); return 1; }

if(PlayerInfo[playerto][pJailed] == 1 && ApprovedLawyer[playerid] == 1)

{

GetPlayerName(playerto, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, sizeof(string), "* You freed %s out of jail.", giveplayer);

SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

format(string, sizeof(string), "* You were freed out of jail, by Lawyer %s.", sendername);

SendClientMessage(playerto, COLOR_LIGHTBLUE, string);

ApprovedLawyer[playerid] = 0;

CallLawyer[playerto] = 0;

JailPrice[playerto] = 0;

PlayerInfo[playerto][pJailTime] = 1;

PlayerInfo[playerid][pLawSkill] ++;

if(PlayerInfo[playerid][pLawSkill] == 50)

{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Lawyer Skill is now Level 2, you will earn more Money and quicker Reload Time."); }

else if(PlayerInfo[playerid][pLawSkill] == 100)

{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Lawyer Skill is now Level 3, you will earn more Money and quicker Reload Time."); }

else if(PlayerInfo[playerid][pLawSkill] == 200)

{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Lawyer Skill is now Level 4, you will earn more Money and quicker Reload Time."); }

else if(PlayerInfo[playerid][pLawSkill] == 400)

{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Lawyer Skill is now Level 5, you will earn more Money and quicker Reload Time."); }

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "Player didnt need a Lawyer / Player aint Jailed !");

}

                    return 1;[/pawn]

2 answers to this question

Recommended Posts

Posted

Acel approvelawyer este problema ta.

Ca lawyer trebuie sa-ti dea un PD/FBI /accept lawyer mai intai ca sa poti elibera pe cineva.

rpg.reality-gaming.ro

Posted

Pune asta

if(strcmp(cmd, "/free", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

    if(PlayerInfo[playerid][pJob] != 2)

    {

        SendClientMessage(playerid, COLOR_GREY, "  You are not a Lawyer!");

        return 1;

    }

    if(PlayerInfo[playerid][pLawSkill] >= 401)

    {

        ApprovedLawyer[playerid] = 1;

    }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{D580FE}Foloseste:{FFFFFF} /free [playerid/PartOfName] [price]");

return 1;

}

new money;

giveplayerid = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

if(!strlen(tmp)) { return 1; }

money = strval(tmp);

if(money < 1 || money > 30000) { SendClientMessage(playerid, COLOR_GREY, "  Price not lower then 1, or above 30000!"); return 1; }

            if(IsPlayerConnected(giveplayerid))

            {

                if(giveplayerid != INVALID_PLAYER_ID)

                {

                    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Free yourself!"); return 1; }

if(PlayerInfo[giveplayerid][pJailed] == 1)

{

                      if(PlayerToPoint(3, playerid,249.2007,67.5946,1003.6406))

  {

                          if(PlayerInfo[giveplayerid][pJailTime] > 1800)

          {

          SendClientMessage(playerid, COLOR_GRAD1, "  Player Jail Time is More than 1800!");

          return 1;

                          }

  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

  GetPlayerName(playerid, sendername, sizeof(sendername));

  format(string, sizeof(string), "* You offerd %s to get out of jail for $%d.", giveplayer, money);

  SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

  format(string, sizeof(string), "* Lawyer %s wants to get you out of jail for $%d, (type /accept lawyer2) to accept.", sendername, money);

  SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);

  LawyerOffer[giveplayerid] = playerid;

  LawyerPrice[giveplayerid] = money;

  }

  else

  {

      SendClientMessage(playerid, COLOR_GREY, "  You`are not in the station PD !");

  }

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Player didnt need a Lawyer / Player aint Jailed !");

}

}

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "  Acest jucator nu este conectat!");

}

}//not connected

return 1;

}

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.