Help PLease + REP
#1

Hello everybody , How can I make to Attach Vehicle to cord z-2
Code is

pawn Код:
//===========================================================================
    if(strcmp(cmd,"/airtow",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    new m = GetVehicleModel(GetPlayerVehicleID(playerid));
                    if (m == 487)
                    {
                        if(GetPlayerState(playerid)==2)
                        {
                            new Float:pX,Float:pY,Float:pZ;
                            GetPlayerPos(playerid,pX,pY,pZ);
                            new Float:vX,Float:vY,Float:vZ;
                            new Found=0;
                            new vid=0;
                            while((vid<MAX_VEHICLES)&&(!Found))
                            {
                                vid++;
                                GetVehiclePos(vid,vX,vY,vZ);
                                if ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
                                {
                                    Found=1;
                                    if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                                    {
                                        DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
                                    }
                                    else
                                    {
                                        AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
                                    }
                                }
                            }
                            if(!Found)
                            {
                                SendClientMessage(playerid,0xFFFF00AA,"There is no car in range.");
                            }
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "You need to be the driver!");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GRAD2, "You need to be in a Helicopter to use this!");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "You need to be in a Helicopter to do this!");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid,COLOR_GRAD2,"You need to be a Mechanic to use this!");
                return 1;
            }
        }
        return 1;
    }
I saw this https://sampforum.blast.hk/showthread.php?tid=84485 and here you can attach vehicle at z-2 , how can I make at mine? Please help. + rep!
Reply
#2

Look I'm not Pro in Scripting but SSCANF will be more Easier and Better and Less Bugs!



I was just trying to help /
Reply
#3

try this:

GetVehiclePos(vid,vX,vY,vZ-2);

Try that at the point you attatch it.

not sure but could work
Reply
#4

REMOVE IsPlayerConnected FROM YOUR COMMAND. PLAYERS WHO ARE NOT CONNECTED CAN NOT TYPE COMMANDS.
Reply
#5

Jari don't work...


please somebody... ?
Reply
#6

Quote:
Originally Posted by MP2
Посмотреть сообщение
REMOVE IsPlayerConnected FROM YOUR COMMAND. PLAYERS WHO ARE NOT CONNECTED CAN NOT TYPE COMMANDS.
i lol'd xD
Reply
#7

Could you highlight the part where you attatch the vehicle?
Reply
#8

To make an screen? sure.
Here

And if I create an new command like /airtow and I put the ID of maverick , attach vehicle to the back wing and car drop... i want to attach the car under the helicopter...
Reply
#9

Why don't you use the code from the thread below the first picture?
It seems totally what you need..
Reply
#10

From Atachvehicle[FS?]
It's not working and It's .... i don't like that have too many publics and...
I have an ideea , if i modifty AttachTrailerTOVehicle with AtachTrailertoVehicle and I create an new public ONLY with atachTrailerTovehicle may work?

But it's an problem , idk how to create an public AtachTrailerToVehicle
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)