License bug
#1

Well the instructor gives /givelicense and when i try to /accept license it says i already have it (though at /licenses it doesnt show)


this is the license part,everything looks fine

pawn Код:
if(LicenseType[playerid] == 0 || LicenseType[playerid] > 5)
                        {
                            return 1;
                        }
                        if(IsPlayerConnected(LicenseOffer[playerid]))
                        {
                            GetPlayerName(LicenseOffer[playerid], giveplayer, sizeof(giveplayer));

                            if(LicenseType[playerid] == 1)
                            {
                                if(PlayerInfo[playerid][pCarLic] == 1)
                                {
                                    SendClientMessage(playerid, COLOR_GREY, "   You have drivers license already.");
                                }
                                else
                                {
                                    format(string, sizeof(string), "* You bought Drivers License for $%d from Instructor %s.",LicensePrice[playerid],giveplayer);
                                    SendClientMessage(playerid, COLOR_WHITE, string);
                                    format(string, sizeof(string), "* %s has bought your Drivers License for $%d and it was added to your PayCheck.",sendername,LicensePrice[playerid]);
                                    SendClientMessage(LicenseOffer[playerid], COLOR_WHITE, string);
                                    PlayerInfo[playerid][pCarLic] = 1;
                                    SafeGivePlayerMoney(playerid, -LicensePrice[playerid]);
                                    PlayerInfo[LicenseOffer[playerid]][pPayCheck] += LicensePrice[playerid] * 5;
                                }
                            }
                            if(LicenseType[playerid] == 2)
                            {
                                if(PlayerInfo[playerid][pFlyLic] == 1)
                                {
                                    SendClientMessage(playerid, COLOR_GREY, "   You have flying license already.");
                                }
                                else
                                {
                                    format(string, sizeof(string), "* You bought Flying License for $%d from Instructor %s.",LicensePrice[playerid],giveplayer);
                                    SendClientMessage(playerid, COLOR_WHITE, string);
                                    format(string, sizeof(string), "* %s has bought your Flying License for $%d and it was added to your PayCheck.",sendername,LicensePrice[playerid]);
                                    SendClientMessage(LicenseOffer[playerid], COLOR_WHITE, string);
                                    PlayerInfo[playerid][pFlyLic] = 1;
                                    SafeGivePlayerMoney(playerid, -LicensePrice[playerid]);
                                    PlayerInfo[LicenseOffer[playerid]][pPayCheck] += LicensePrice[playerid] * 5;
                                }
                            }
                            if(LicenseType[playerid] == 3)
                            {
                                if(PlayerInfo[playerid][pBoatLic] == 1)
                                {
                                    SendClientMessage(playerid, COLOR_GREY, "   You have Sailing license already.");
                                }
                                else
                                {
                                    format(string, sizeof(string), "* You bought Sailing License for $%d from Instructor %s.",LicensePrice[playerid],giveplayer);
                                    SendClientMessage(playerid, COLOR_WHITE, string);
                                    format(string, sizeof(string), "* %s has bought your Sailing License for $%d and it was added to your PayCheck.",sendername,LicensePrice[playerid]);
                                    SendClientMessage(LicenseOffer[playerid], COLOR_WHITE, string);
                                    PlayerInfo[playerid][pBoatLic] = 1;
                                    SafeGivePlayerMoney(playerid, -LicensePrice[playerid]);
                                    PlayerInfo[LicenseOffer[playerid]][pPayCheck] += LicensePrice[playerid] * 5;
                                }
                            }
                            if(LicenseType[playerid] == 4)
                            {
                                if(PlayerInfo[playerid][pFishLic] == 1)
                                {
                                    SendClientMessage(playerid, COLOR_GREY, "   You have Fishing license already.");
                                }
                                else
                                {
                                    format(string, sizeof(string), "* You bought Fishing License for $%d from Instructor %s.",LicensePrice[playerid],giveplayer);
                                    SendClientMessage(playerid, COLOR_WHITE, string);
                                    format(string, sizeof(string), "* %s has bought your Fishing License for $%d and it was added to your PayCheck.",sendername,LicensePrice[playerid]);
                                    SendClientMessage(LicenseOffer[playerid], COLOR_WHITE, string);
                                    PlayerInfo[playerid][pFishLic] = 1;
                                    SafeGivePlayerMoney(playerid, -LicensePrice[playerid]);
                                    PlayerInfo[LicenseOffer[playerid]][pPayCheck] += LicensePrice[playerid] * 5;
                                }
                            }
                            if(LicenseType[playerid] == 5)
                            {
                                if(PlayerInfo[playerid][pGunLic] == 1)
                                {
                                    SendClientMessage(playerid, COLOR_GREY, "   You have Weapon license already.");
                                }
                                else
                                {
                                    format(string, sizeof(string), "* You bought Weapon License for $%d from Instructor %s.",LicensePrice[playerid],giveplayer);
                                    SendClientMessage(playerid, COLOR_WHITE, string);
                                    format(string, sizeof(string), "* %s has bought your Weapon License for $%d and it was added to your PayCheck.",sendername,LicensePrice[playerid]);
                                    SendClientMessage(LicenseOffer[playerid], COLOR_WHITE, string);
                                    PlayerInfo[playerid][pGunLic] = 1;
                                    SafeGivePlayerMoney(playerid, -LicensePrice[playerid]);
                                    PlayerInfo[LicenseOffer[playerid]][pPayCheck] += LicensePrice[playerid] * 5;
                                }
                            }
                            LicenseOffer[playerid] = 999;
                            LicensePrice[playerid] = 0;
                            LicenseType[playerid] = 0;
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   You can't afford that License !");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   No-one offerd you any License !");
                    return 1;
                }
            }


its from raven's roleplay,the one bugged as hell ....and dont tell me to post there,i tried,nobody answers that topic

p.s: the code doesnt end there it goes on with offers for sex & etc ,thats the license part only ,if i dont fix that ill have to delete the entire faction cause its useless ....
Reply
#2

BUMP

i changed the script a little so you can give licenses even if the other player has them so it works giving ,but the status (not passed) doesnt seem to update for some of them,any idea on how to fix that?
Reply
#3

did you write LicenseType[playerid] = 0; OnPlayerConnect?
Reply
#4

yes its there,it looks like the fishing license is causing this problem ,for example flying is not passed,i get the license from licensers faction ,it still says not passed at status /licenses(though i can fly now) and if i get the fishing license the "status" fixes and shows that Flying License - Passed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)