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



Car tow - ziggy - 23.01.2014

I was searching a lot but i cant find tow system which allowe to all cars can tow all cars
i need to can car tow car...
example
to tow uranus with elegy.when car is back from you you cant type /tow and start towing
can anyone help me with this please
thank you


Re: Car tow - Scottas - 23.01.2014

You can edit existing system to fit your requirements. Just skip towing vehicle check


Re: Car tow - ziggy - 23.01.2014

i dont have any system for towing,can you please edit it and give me pastebin?


Re: Car tow - Scottas - 23.01.2014

I'm not having any system too. Try to search for it.


Re: Car tow - ziggy - 23.01.2014

this
https://sampforum.blast.hk/showthread.php?tid=11753
but i want to pull with car now with tow truck


Re: Car tow - Scottas - 23.01.2014

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
    if ((newkeys==KEY_ACTION)&&(IsPlayerInAnyVehicle(playerid))&&(GetPlayerState(playerid)==PLAYER_STATE_DRIVER))
        {
            SendClientMessage(playerid,0xFFFF00AA,"trying to tow a car");
            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));
                        }
                    AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
                    SendClientMessage(playerid,0xFFFF00AA,"Car towed!");
                    }
                }
            if  (!Found)
                {
                SendClientMessage(playerid,0xFFFF00AA,"There is no car in range.");
                }
        }
    }
Try this


Re: Car tow - ziggy - 23.01.2014

Thank you very much,i will try!


Re: Car tow - ziggy - 23.01.2014

C:\Documents and Settings\Nikola Radosavljevic\Desktop\tow.pwn(1) : warning 235: public function lacks forward declaration (symbol "OnPlayerKeyStateChange")
C:\Documents and Settings\Nikola Radosavljevic\Desktop\tow.pwn(3) : error 017: undefined symbol "KEY_ACTION"
C:\Documents and Settings\Nikola Radosavljevic\Desktop\tow.pwn(5) : error 017: undefined symbol "SendClientMessage"
C:\Documents and Settings\Nikola Radosavljevic\Desktop\tow.pwn(7) : error 017: undefined symbol "GetPlayerPos"
C:\Documents and Settings\Nikola Radosavljevic\Desktop\tow.pwn(11) : error 017: undefined symbol "MAX_VEHICLES"
C:\Documents and Settings\Nikola Radosavljevic\Desktop\tow.pwn(14) : error 017: undefined symbol "GetVehiclePos"
C:\Documents and Settings\Nikola Radosavljevic\Desktop\tow.pwn(15) : error 017: undefined symbol "floatabs"
C:\Documents and Settings\Nikola Radosavljevic\Desktop\tow.pwn(1 : error 017: undefined symbol "IsTrailerAttachedToVehicle"
C:\Documents and Settings\Nikola Radosavljevic\Desktop\tow.pwn(20) : error 017: undefined symbol "DetachTrailerFromVehicle"
C:\Documents and Settings\Nikola Radosavljevic\Desktop\tow.pwn(22) : error 017: undefined symbol "AttachTrailerToVehicle"
C:\Documents and Settings\Nikola Radosavljevic\Desktop\tow.pwn(23) : error 017: undefined symbol "SendClientMessage"
C:\Documents and Settings\Nikola Radosavljevic\Desktop\tow.pwn(2 : error 017: undefined symbol "SendClientMessage"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


11 Errors.


Re: Car tow - Scottas - 23.01.2014

you just trying to compile that code I gave, Its just part of code, not full gamemode or filterscript. You need to include it to your current gamemode or filterscript.


Re: Car tow - ziggy - 23.01.2014

Can you give me full please