SA-MP Forums Archive
Can't fix a warning need some help - 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: Can't fix a warning need some help (/showthread.php?tid=350903)



Can't fix a warning need some help - KosmasRego - 14.06.2012

When I compile I get a warning on line 1140 that I can't fix please need some help.

pawn Код:
CMD:rentveh(playerid, params[])
{
    if(!PLAYER_STATE_DRIVER) return SCM(playerid, COLOR_WHITE, "You need to be in a renting vehicle to rent a car.");
    else if(PlayerInfo[playerid][pRentingVeh] == 1) return SCM(playerid, COLOR_WHITE, "You are already renting a vehicle.");
    else
    {
        TogglePlayerControllable(playerid, 1);
        SCM(playerid, COLOR_ORANGE, "To unrent the vehicle type /unrentveh");
        PlayerInfo[playerid][pRentingVeh] = 1;
    }
    return 1;
}

Line 1140 is
pawn Код:
if(!PLAYER_STATE_DRIVER) return SCM(playerid, COLOR_WHITE, "You need to be in a renting vehicle to rent a car.");



Re: Can't fix a warning need some help - JaKe Elite - 14.06.2012

change

pawn Код:
if(!PLAYER_STATE_DRIVER) return SCM(playerid, COLOR_WHITE, "You need to be in a renting vehicle to rent a car.");
to

pawn Код:
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid, COLOR_WHITE, "You need to be in a renting vehicle to rent a car.");



Re: Can't fix a warning need some help - KosmasRego - 14.06.2012

Thanks it worked.