SA-MP Forums Archive
Please Help me - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Please Help me (/showthread.php?tid=545420)



Please Help me - Adarsh007 - 08.11.2014

<Removed> I FIXED


Re: Please Help me - biker122 - 08.11.2014

pawn Код:
dcmd_usebcard(playerid,params[])
{
    #pragma unused params
    new string[128];
    if(BailCards[playerid] <= 0)
    {
        SendClientMessage(playerid, COLOR_ERROR, "You don't have any Bail Cards!");
        return 1;
    }
    if(JailTime[playerid] == 0)
    {
       SendClientMessage(playerid,COLOR_ERROR,"You aren't in jail , From where can you escape ?!");
       return 1;
    }
    if(AttemptedToEscapeFromJail[playerid] >= 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You are tired from the last try to escape from jail. Please wait..");
        return 1;
    }
    if(JailedByAdmin[playerid] == 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You can't use this command because you are jailed by an Admin.");
        return 1;
    }
    BailCards[playerid]--;
    format(string,sizeof(string),"%s(%d) has used one of his Bail Cards and went out from jail.",PlayerName(playerid),playerid);
    SendClientMessageToAll(COLOR_ADMIN,string);
    TotalJailTime[playerid] =0;
    JailTime[playerid] =0;
    SetPlayerPos(playerid, 1545.2606,-1674.9889,13.5600);
    SetPlayerInterior(playerid, 0);
    return 1;
}
You aren't checking whether they have a bail card..