SA-MP Forums Archive
Car Limit - 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: Car Limit (/showthread.php?tid=495063)



Car Limit - andrein2 - 15.02.2014

Hi , i want to limit my faction cars but , i have an error

pawn Код:
new Taxi[15];
pawn Код:
if(newcar => Taxi[0] && newcar =< Taxi[10])
        {
            if(PlayerInfo[playerid][pMember] != 10 && PlayerInfo[playerid][pLeader] != 10)
            {
                SendClientMessage(playerid,COLOR_WHITE,"Nu esti membru {FFFF00}Agentia Taxi{FFFFFF}!");
                RemovePlayerFromVehicle(playerid);
            }
            if(newcar => Taxi[4] && newcar =< Taxi[7] && PlayerInfo[playerid][pRank] < 2)
            {
                SendClientMessage(playerid,COLOR_GREY,"Iti trebuie {FFFF00}rank 2{FFFFFF}!");
                RemovePlayerFromVehicle(playerid);
            }
            if(newcar => Taxi[8] && newcar =< Taxi[9] && PlayerInfo[playerid][pRank] < 4)
            {
                SendClientMessage(playerid,COLOR_GREY,"Iti trebuie {FFFF00}rank 4{FFFFFF}!");
                RemovePlayerFromVehicle(playerid);
            }
            if(newcar == Taxi[10]  && PlayerInfo[playerid][pRank] < 6)
            {
                SendClientMessage(playerid,COLOR_GREY,"Iti trebuie {5D4F3E}rank 6{FFFFFF}!");
                RemovePlayerFromVehicle(playerid);
            }
        }
At this line is the error
pawn Код:
newcar => Taxi[0] && newcar =< Taxi[10]
And The Error
pawn Код:
E:\Server Samp\gamemodes\XGamers.pwn(7743) : warning 211: possibly unintended assignment
E:\Server Samp\gamemodes\XGamers.pwn(7743) : error 029: invalid expression, assumed zero
E:\Server Samp\gamemodes\XGamers.pwn(7743) : error 022: must be lvalue (non-constant)
E:\Server Samp\gamemodes\XGamers.pwn(7743) : error 029: invalid expression, assumed zero
E:\Server Samp\gamemodes\XGamers.pwn(7743) : fatal error 107: too many error messages on one line



Re: Car Limit - CuervO - 15.02.2014

>= and <=

not

=> and =<

Also, that check will most likely fail, nothing assures you that Taxi[0] to Taxi[10] are consecutive numbers. You need a loop, or check them individually.


Re: Car Limit - andrein2 - 15.02.2014

And how to make the comand to work ? I put
pawn Код:
if(newcar => Taxi[0] && newcar <= Taxi[10])
But no work


Re: Car Limit - FreakyFlan1990 - 15.02.2014

Change:
Код:
if(newcar => Taxi[0] && newcar <= Taxi[10])
To:
Код:
if(newcar >= Taxi[0] && newcar <= Taxi[10])



Re: Car Limit - andrein2 - 15.02.2014

I saw And Thx to all