How to fix that?
#1

I want to make if player is near Plane,Bike,Heli and so on.. it will write "This vehicle doesn't have trunk" but this code isn't working, help please.

pawn Код:
if(!strcmp(cmdtext, "/trunk", true) || !strcmp(cmdtext, "/tr", true))
    {
        for(new vid; vid<MAX_VEHICLES; vid++)
        {
            new Float: vx, Float:vy, Float:vz;
            GetVehiclePos(vid,vx,vy,vz);
            GetXYBehindCar(vid, vx, vy, 3.5);
            if(IsPlayerInRangeOfPoint(playerid,1.5,vx,vy,vz))
            {
                if(!IsModelAPlane(vid) || !IsModelABike(vid) || !IsModelAHeli(vid) || !IsModelABoat(vid) || !IsModelASpecial(vid))
                {
                    ShowPlayerDialog(playerid, DIALOG_TRUNK, DIALOG_STYLE_LIST, "Choose an option", "{5555FF}Open/Close the trunk \n{5555FF}Put in trunk \n{5555FF}Take from trunk", "Select", "Close");
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, -1, "{FF6A22}INFO: {FFFFFF}This vehicle doesn't have trunk!");
                    return 1;
                }
            }
        }
        return 1;
    }
Reply
#2

don't you want a check for:
pawn Код:
if(!IsModelAPlane(vid) && !IsModelABike(vid) && !IsModelAHeli(vid) && !IsModelABoat(vid) && !IsModelASpecial(vid))
                {
?
(and the range is pretty small, if you are sure you are really in it, leave it like it is, otherwise I'd suggest you to start with a higher range - at least for testing)
Reply
#3

Quote:
Originally Posted by Sascha
Посмотреть сообщение
don't you want a check for:
pawn Код:
if(!IsModelAPlane(vid) && !IsModelABike(vid) && !IsModelAHeli(vid) && !IsModelABoat(vid) && !IsModelASpecial(vid))
                {
?
(and the range is pretty small, if you are sure you are really in it, leave it like it is, otherwise I'd suggest you to start with a higher range - at least for testing)
Yeah I want to make it if VEHICLE ISN'T model heli, bike etc etc.. it will open dialog else error msg.
Reply
#4

did you try it with my code? the && instead of your ||?
Reply
#5

Yeah it's working Rep + for you ty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)