Jump to content

GTA:SA Cooperation Edition


BartiCoderNoob

Recommended Posts

 

26194560_907440489418472_1824377407_o.png?oh=cfd71f31cdfa89045077cee97259bc2a&oe=5A4919D1

Hello World, 

having been playing a lot of different GTA games, for about 3 years on many different SAMP and MTA servers with friends. Including going through the GTA story line many times . I thought that it would be a great variety to create a possibily of two players going through the whole story line together. I searched the internet to find a solution. I came across a user NewbProgramming, who wrote on the forum that he wants to do something similar. However I do not know the progress in his project. I decided to take matters into my own hands and write such a script myself at LUA. There is a lot of work involved, but if anyone knows a tool that could help me, then please contact me on this forum, maybe there is a script that will automatically convert the singleplayer code to MTA LUA?


Here is my ideas, how to match missions into two players mode:
 

Spoiler

LOS SANTOS - 29 missions
In the Beginning  - When together log in to the server, 2 bikes appears, twins make the way back to Grove Street by following CJ blip on the radar, in front of the door is a red marker which starts the firts mission

Big Smoke – twins meet Big Smoke inside the Johnson House, after "cutscene" together enter a car and with Big Smoke go to grave yard.

Sweet & Kendl – after cutscene, twins have to enter to bikes and by following Ryder and BigSmoke escape from the Ballas to Grove Street, where the red marker indicates cutscene, after that Ryder call to CJ and "invite" twins to the next mission

RyderCarl and David enter to marker by Ryder's house in Grove Street. He asks twins to come to a local pizza store in Idlewood , to which they agree. The three get into Ryder's Regina and drive over to the barber shop. CJ and DJ go inside the barber shop and get a new haircuts. Afterwards, twins go back outside and Ryder tells them to go over to the pizza place across the street.. After CJ orders the food, Ryder walks over to the counter with a gun and attempts to rob the premises. However, the clerk recognises Ryder, frightens Ryder and Carl off with a shotgun. The three flee outside and get into Ryder's Regina. Carl, David and Ryder drive back to Ryder's house in Grove Street. After returning to Grove Street, Ryder tells them to go over and see Sweet at his house to talk to him about the graffiti all across the hood.

Tagging Up Turf - Carl and DJ arrive at Sweet's house. Sweet hands CJ and DJ cans of spray paint and tells them to go spray over enemy tags. Sweet suddenly decides to go with twins and they drive over to Idlewood. Sweet shows how to tag over an enemy gang tag and tells twins to go spray over two more tags in nearby. Carl and David spray over the two tags nearby and then get back into car. The Johnson Brothers drive over to East Los Santos. They arrive there and Sweet tells to go spray over some more tags. Carl and David are left alone and encounter two Ballas in an alleyway right near a tag, who act hostile towards them after they see them spray over their tag. Twins escape them and jump a fence into another nearby alleyway. One of twins has to climb onto a small building, where he sprays over one final tag. Afterwards, Sweet rushes back and tells twins to quickly get in. They both run over to Sweet and they drive back to Grove Street. The three reach Sweet's house, to which Sweet gives them some money before splitting up.

and so on...
 

and here is a little bit changed story line:
 

Spoiler

Twins Carl  and David Johnson (CJ and DJ) return home to Los Santos and need to reestablish theyself in the neighborhood. Years previously, the death of their brother, Brian Johnson, was blamed on they by their elder brother, Sweet, Carl and David moved away for a fresh start in Liberty City. Following the death of their mother in a drive-by shooting, they return and decide to stay for good. Missions involve they working for the prominent members of the Grove Street Families: their brother Sweet, childhood friend and junkie Ryder, and cryptic childhood friend, Big Smoke. Other than those three, CJ and DJ participate in illicit street racing with their sister Kendl's boyfriend, Cesar Vialpando, who faces a lot of prejudice from Sweet, who looks down on Cesar being Mexican. Twins also do missions for OG Loc, a GSF associate obsessed with his "gangsta" rapper image but in reality, his crimes range from parking fines to joyriding. Meanwhile, C.R.A.S.H., led by Frank Tenpenny and Eddie Pulaski, exploit CJ and DJ into doing their dirty work, under the threat of framing they for Officer Pendelbury's murder, which they committed themselves.

 

 

and here are my scraps of code which i wrote to this time:
 

Spoiler

MISSIONS SCRIPT:

Spoiler

meta.xml



<meta>
	<info author="Barti" title="missions" version="0.1"/>
	<script src="missions.lua" type="server"/>
	<cop>true</cop>
</meta>

 

missions.lua
 



-- Story line missions script wrote by Barti --
-- special thanks to Melbourne and Enargy from forum.multitheftauto.com --

local x1, y1, z1, rx1, ry1, rz1  = 2243.2, -1263.2, 23.5, 0, 0, 270
local x2, y2, z2, rx2, ry2, rz2  = 2246.2, -1263.2, 23.5, 0, 0, 270

addEventHandler ( "onPlayerJoin", getRootElement(),
	function() 
		getElementPosition( source, x1, y1, z1 )
		Bike1 = createVehicle ( 481, 0, 0, 0 )
		setVehicleColor( Bike1, 80,125,141 )
		spawnVehicle( Bike1, x1, y1, z1, rx1, ry1, rz1)
    local spawnVeh = spawnVehicle ( Bike1, x1, y1, z1, rx1, ry1, rz1 )
		local xb1, yb1, zb1 = getElementPosition ( Bike1 )
		mBike1 = createMarker ( xb1, yb1, zb1, "arrow", 1, 0, 0, 255, 170 )
		attachElements ( mBike1, Bike1, 0, 0, 2 )
		local driver = getVehicleOccupant (Bike1) 
		
	end)

addEventHandler ( "onPlayerJoin", getRootElement(),
	function() 
		getElementPosition( source, x2, y2, z2 )
		Bike2 = createVehicle ( 481, 0, 0, 0 )
		setVehicleColor( Bike2, 88,142,110 )
		spawnVehicle( Bike2, x2, y2, z2, rx2, ry2, rz2)
    local spawnVeh = spawnVehicle ( Bike2, x2, y2, z2, rx2, ry2, rz2 )
		local xb2, yb2, zb2 = getElementPosition ( Bike2 )
		mBike2 = createMarker ( xb2, yb2, zb2, "arrow", 1, 0, 0, 255, 170 )
		attachElements ( mBike2, Bike2, 0, 0, 2 )
		local driver = getVehicleOccupant (Bike2)
		
	end)
	
addEventHandler("onVehicleEnter", root,
	function ( player )
		if ( source == Bike1 ) then 
			destroyElement( mBike1 )
			outputChatBox("Follow the 'CJ' icon on the radar to get back to the hood.")
			mFirstMis = createMarker ( 2495.2, -1687.3, 12.5, "cylinder", 1.5, 255, 0, 0, 255 )
			bFirstMis = createBlip ( 2495.2, -1687.3, 12.5, 15)
		end
	end)
	
addEventHandler("onVehicleEnter", root,
	function ( player )
		if ( source == Bike2 ) then 
			destroyElement( mBike2 )
		end
	end)
	
setElementPosition ( Player, 2496.05, -1692.73, 1013.75 )

addEventHandler("onPlayerMarkerHit", getRootElement(),
	function( marker, matchingDimension )
		if (matchingDimension) then
			setElementPosition ( Player, 2496.05, -1692.73, 1013.75 )
		end
	end
)
	
addEventHandler("onPlayerMarkerHit", getRootElement(),
	function( marker, matchingDimension )
		if (matchingDimension) then
			if isElement(mFirstMis) and isElement(bFirstMis) and marker == mFirstMis then
				destroyElement( mFirstMis )
				destroyElement( bFirstMis )
				mFirstMis, bFirstMis = nil, nil
			end
		end
	end
)	

 

GAMEMODE SCRIPT:

Spoiler

meta.xml



<meta>
	<info author="Barti" title="cooperation" version="0.1"/>

	<script src="main.lua" type="server"/>
	<cop>true</cop>
</meta>

main.lua



local spawnX, spawnY, spawnZ, spawnR = 2235.6504, -1260.8429, 23.9350, 270
local id = 0
function joinHandler()
	spawnPlayer(source, spawnX, spawnY, spawnZ, spawnR, id)
		if getPlayerCount() == 1 then
		addPedClothes (source, "vest", "vest", 0 )
		else
		addPedClothes (source, "vestblack", "vest", 0 )
		end
	fadeCamera(source, true)
	setCameraTarget(source, source)
end
addEventHandler("onPlayerJoin", getRootElement(), joinHandler)

addEventHandler( "onPlayerWasted", getRootElement( ), function()
		myDisplay = textCreateDisplay ()
		textDisplayAddObserver ( myDisplay, source )
		myTextItem = textCreateTextItem ( "Wasted!", 0, 0, high, 255, 0, 0, 255, 4)
		local wastedText = textDisplayAddText ( myDisplay, myTextItem )
	setTimer( spawnPlayer, 5000, 1, source, 2019.1, -1429.3, 13.54, 135	)
	end)

 

 

I hope you like it :D If you are interested in or want to help somehow, leave a sing ;-)

Edited by BartiCoderNoob
Addem missions description
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...