SA-MP Forums Archive
Help PLease + REP - 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: Help PLease + REP (/showthread.php?tid=335244)



Help PLease + REP - RaulSTARs - 17.04.2012

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!


Re: Help PLease + REP - Andrew97 - 17.04.2012

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



I was just trying to help /


Re: Help PLease + REP - Jstylezzz - 17.04.2012

try this:

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

Try that at the point you attatch it.

not sure but could work


Re: Help PLease + REP - MP2 - 17.04.2012

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


Re: Help PLease + REP - RaulSTARs - 18.04.2012

Jari don't work...


please somebody... ?


Re: Help PLease + REP - DBan - 18.04.2012

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


Re: Help PLease + REP - Jstylezzz - 18.04.2012

Could you highlight the part where you attatch the vehicle?


Re: Help PLease + REP - RaulSTARs - 18.04.2012

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...


Re: Help PLease + REP - Jstylezzz - 18.04.2012

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


Re: Help PLease + REP - RaulSTARs - 18.04.2012

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