Help me!!
#1

Hello i have posted many issues that needs a solution so please take a look and give me ideas anyways here are some more issues.
1. How to set max jail time when u are transfered to jail. I mean if the time is 2min if you do a crime it dosn't increase more then 5min even if u do crimes rapidly.
2. Same thing applies on rob cmd that u can rob 500k max at a percentage of the victim's money in hand.
Reply
#2

Just make sure the value of the crime is not bigger then 5 minutes in seconds for example:

pawn Код:
CMD:jail(playerid, params[])
{
     if(sscanf(params, "ui", targetid, amount)) return SendClientMessage(playerid, WHITE, "USAGE: /jail [playerid] [time]");
     if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, RED, "This player is not logged-in");
     SetPlayerPos(targetid, JAILX, JAILY, JAILZ);
     PlayerInfo[targetid][Jailed] = 1;
     new Jailedtime = PlayerInfo[targetid][JailedTime];
     if((amount) + (JailedTime) > 300)
     {
          PlayerInfo[targetid][JailedTime] = 300;
          return 1;
          SendClientMessage(playerid, WHITE, "Player %s has been jailed for 5 minutes as he reached the jail time max." GetPlayerName(playerid));
     }
     else
     {
          PlayerInfo[targetid][JailedTime] += amount;
          SendClientMessage(playerid, WHITE, "Player %s has been jaield for %d minutes." GetPlayerName(playerid), PlayerInfo[targetid][JailedTime]);
          return 1;
     }
}
THIS MIGHT NOT WORK FOR YOUR SCRIPT, So change it based on your script.
Reply
#3

I am using Mysql database
Reply
#4

Then just look at my format and make it MySQL.
Reply
#5

And what about rob issue
Reply
#6

pawn Код:
CMD:rob(playerid, params[])
{
     if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, WHITE, "USAGE: /rob [playerid]");
     if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, RED, "This player is not logged-in");
     new Robbed = GetPlayerMoney(targetid);
     new CurrentMoney = GetPlayerMoney(playerid);
     if((Robbed) > 500000)
     {
          GivePlayerMoney(targetid, Robbed -500000);
          GivePlayerMoney(playerid, CurrentMoney +500000);
          SendClientMessage(playerid, WHITE, "You have robbed 500,000$ of %s money." GetPlayerName(playerid));
          return 1;
     }
     else
     {
          GivePlayerMoney(targetid, -Robbed);
          GivePlayerMoney(playerid, +Robbed);
          SendClientMessage(playerid, WHITE, "You have robbed %d$ of %s money." Robbed, GetPlayerName(playerid));
          return 1;
     }
}
Once again this might not work, make sure you set this thing right to YOUR script.
Reply
#7

Nope didn't work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)