/rentbike Not working
#1

Why This Command Is Not Working? It Doesn't Send Me Any Message:

pawn Код:
if(strcmp(cmd, "/rentbike", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(GetPlayerVehicleID(playerid) >= 112 && GetPlayerVehicleID(playerid) <= 130)
            {
                new hirefee = HireCost(GetPlayerVehicleID(playerid));
                if(SBizzInfo[0][sbProducts] == 1)
                {
                    GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
                    return 1;
                }
                /*if(PlayerInfo[playerid][pPbiskey] == 0)
                {
                    GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3);
                    TogglePlayerControllable(playerid, 1);
                    return 1;
                }*/

                if (GetPlayerMoney(playerid) <  SBizzInfo[0][sbEntranceCost])
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "   You dont have that much cash !");
                    return 1;
                }
                if(HireCar[playerid] != 299)
                {
                    gCarLock[HireCar[playerid]] = 0;
                    UnLockCar(HireCar[playerid]);
                    SendClientMessage(playerid, COLOR_GREY, "You need unrent your current car/bike/boat first !");
                    return 1;
                }
                for(new i=0; i<MAX_PLAYERS; i++)
                {
                    if(HireCar[i] == GetPlayerVehicleID(playerid))
                    {
                        SendClientMessage(playerid, COLOR_GREY, "    Someone already rents this car !");
                        return 1;
                    }
                }
                SafeGivePlayerMoney(playerid,-SBizzInfo[0][sbEntranceCost]);
                SBizzInfo[0][sbTill] += SBizzInfo[0][sbEntranceCost];
                ExtortionSBiz(0, SBizzInfo[0][sbEntranceCost]);
                SBizzInfo[0][sbProducts]--;
                HireCar[playerid] = GetPlayerVehicleID(playerid);
                OnPropUpdate(3,0);
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                format(string, sizeof(string), "~w~Don't forget to ~b~/unrentbike~n~~g~/lock ~w~to lock your bike",hirefee);
                TogglePlayerControllable(playerid, 1);
                gEngine[GetPlayerVehicleID(playerid)] = 1;
                GameTextForPlayer(playerid, string, 5000, 3);

                new y, m, d;
                new h,mi,s;
                getdate(y,m,d);
                gettime(h,mi,s);
                format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /rentbike",d,m,y,h,mi,s,sendername);
                CommandLog(string);
            }
        }
        return 1;
    }
Reply
#2

Anyone??
Reply
#3

BuMp
Reply
#4

pawn Код:
if(strcmp(cmdtext, "/rentbike", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(GetPlayerVehicleID(playerid) >= 112 && GetPlayerVehicleID(playerid) <= 130)
            {
                new hirefee = HireCost(GetPlayerVehicleID(playerid));
                if(SBizzInfo[0][sbProducts] == 1)
                {
                    GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
                    return 1;
                }
                /*if(PlayerInfo[playerid][pPbiskey] == 0)
                {
                    GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3);
                    TogglePlayerControllable(playerid, 1);
                    return 1;
                }*/

                if (GetPlayerMoney(playerid) <  SBizzInfo[0][sbEntranceCost])
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "   You dont have that much cash !");
                    return 1;
                }
                if(HireCar[playerid] != 299)
                {
                    gCarLock[HireCar[playerid]] = 0;
                    UnLockCar(HireCar[playerid]);
                    SendClientMessage(playerid, COLOR_GREY, "You need unrent your current car/bike/boat first !");
                    return 1;
                }
                for(new i=0; i<MAX_PLAYERS; i++)
                {
                    if(HireCar[i] == GetPlayerVehicleID(playerid))
                    {
                        SendClientMessage(playerid, COLOR_GREY, "    Someone already rents this car !");
                        return 1;
                    }
                }
                SafeGivePlayerMoney(playerid,-SBizzInfo[0][sbEntranceCost]);
                SBizzInfo[0][sbTill] += SBizzInfo[0][sbEntranceCost];
                ExtortionSBiz(0, SBizzInfo[0][sbEntranceCost]);
                SBizzInfo[0][sbProducts]--;
                HireCar[playerid] = GetPlayerVehicleID(playerid);
                OnPropUpdate(3,0);
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                format(string, sizeof(string), "~w~Don't forget to ~b~/unrentbike~n~~g~/lock ~w~to lock your bike",hirefee);
                TogglePlayerControllable(playerid, 1);
                gEngine[GetPlayerVehicleID(playerid)] = 1;
                GameTextForPlayer(playerid, string, 5000, 3);

                new y, m, d;
                new h,mi,s;
                getdate(y,m,d);
                gettime(h,mi,s);
                format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /rentbike",d,m,y,h,mi,s,sendername);
                CommandLog(string);
            }
        }
        return 1;
    }
Try that? Why do you have "cmd" after "strcmp(cmd" ? It should be "cmdtext". Try it.
Reply
#5

not working,i am using Linux server
Reply
#6

anyone? it works on windows server but doesn't work on linux server
Reply
#7

Please Help me i will +REP.
Reply
#8

Please Help
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)