Jump to content

manhunt Game Mode


kalitonchik

Recommended Posts

Hello

Again, I need help from you :!:

this time to develop manhunt game mode :wink:

the game plan similar to the zombie mode :roll:

in the manhunt game mode issue differently :P

at the beginning of the manhunt game mode all players is normal :!:

But the death of one player will result in that game is a new team - hunters :arrow:

normal players become team - wanted players :!:

which should survive, but it is difficult because dead players from wanted team are moving in the hunter team

It's cool when a large number of players with saws hunt a last survivor from the wanted team :!:

wanted team equipped with bat and a pistol colt :wink:

hunter team equipped with a saw :twisted:

Tunb problem is that I do not know how to create :!::?::mrgreen:

that first, all were in one team :!:

dead go to another team :!:

and that round ends on the last survivor :!:

huntervd2.png

wanteddn5.png

please help

Link to comment

my server side script in progress

function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension )

addPlayerClothes ( source, "hoodjack", "hoodjackbeige", 49 )

addPlayerClothes ( source, "chinosb", "chinosbiege", 28 )

addPlayerClothes ( source, "conv", "convheatorn", 22 )

addPlayerClothes ( source, "balaclava", "balaclava", 5 )

setPlayerStat ( source, 22, 500 ) --Muscles

setPlayerStat ( source, 23, 999 ) --Stamina

setPlayerStat ( source, 24, 100 ) --Max Health

setPlayerStat ( source, 78, 999 ) --Pistol Skill

setPlayerStat ( source, 80, 999 ) --Sex Appeal clothes

giveWeapon ( source, 22, 999 ) --Pistol

giveWeapon ( source, 5, 1 ) --Baseball Bat

setElementHealth ( source, 180 )

end

function playerDied()

outputChatBox(getClientName(source).." died!")

spawnPlayer ( xxx )

and spawn in hunter team

end

Link to comment

[22:45:49] Mode vote started by $.Kalitonchik(LV.

[22:45:52] $.Kalitonchik(LV voted 7 (manhunt game mode)

[22:45:52] Vote ended! [manhunt game mode]

[22:45:52] Starting manhunt game mode

[22:45:52] start: Resource 'manhunt game mode' started

[22:45:52] Gamemode 'manhunt game mode' started.

[22:45:59] QUIT: $.Kalitonchik(LV left the game [Quit]

[22:46:03] Server stopped!

[22:46:03] Stopping resources...............

[22:46:03] Closing SQLite3 database

please help

I have a problem

you can see in my script no errors :!:

resource started :arrowdown:

but I can't SPAWN :!:

Who can say where the error occurred :!::?::-k

please write the correct sctipt

  • function greetPlayer ( )
    local joinedPlayerName = getClientName ( source )
    outputChatBox ( "Welcome " .. joinedPlayerName .. " to the server!" , source, 255, 255, 255 )
    spawnPlayer ( source, -1814, -116, 5.5 )
    end
    addEventHandler ( "onPlayerJoin", getRootElement(), greetPlayer )
    function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension )
    addPlayerClothes ( source, "hoodjack", "hoodjackbeige", 49 )
    addPlayerClothes ( source, "chinosb", "chinosbiege", 28 )
    addPlayerClothes ( source, "conv", "convheatorn", 22 )
    addPlayerClothes ( source, "balaclava", "balaclava", 5 )
    setPlayerStat ( source, 22, 500 ) --Muscles
    setPlayerStat ( source, 23, 999 ) --Stamina
    setPlayerStat ( source, 24, 100 ) --Max Health
    setPlayerStat ( source, 78, 999 ) --Pistol Skill
    setPlayerStat ( source, 80, 999 ) --Sex Appeal clothes
    giveWeapon ( source, 22, 999 ) --Pistol
    giveWeapon ( source, 5, 1 ) --Baseball Bat
    setElementHealth ( source, 180 )
    end
    addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn )
    function quitPlayer ( reason )
    local quittingPlayerName = getClientName ( source )
    outputChatBox ( quittingPlayerName .. " has left the server (" .. reason .. ")" )
    end
    addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer )
    function playerDied(totalAmmo, killer, killerWeapon, bodypart)
    outputChatBox(getClientName(source).." died!")
    spawnPlayer ( source, -1859, -132.5, 12 )
    end
    function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension )
    addPlayerClothes ( source, "tramline", "tramline", 17 )
    addPlayerClothes ( source, "hockeymask", "hockey", 15 )
    addPlayerClothes ( source, "bask1", "timbergrey", 28 )
    addPlayerClothes ( source, "countrytr", "countrytr", 2 )
    setPlayerStat ( source, 22, 999 ) --Muscles
    setPlayerStat ( source, 23, 999 ) --Stamina
    setPlayerStat ( source, 24, 100 ) --Max Health
    setPlayerStat ( source, 78, 999 ) --Chainsaw Skill
    setPlayerStat ( source, 80, 999 ) --Sex Appeal clothes
    giveWeapon ( source, 9, 1 ) --Chainsaw
    setElementHealth ( source, 180 )
    end
    addEventHandler("onPlayerWasted",getRootElement(),playerDied)

Link to comment

How do you want to spawn player when you start gamemode if you didn't use the event that is triggered when gamemode starts? You spawn player when he joins the server or dies, so how can you spawn player that already joined and is already spawned? Use onGamemodeStart or onResourceStart event.

http://development.mtasa.com/index.php? ... _Gamemodes

http://development.mtasa.com/index.php? ... Mapmanager

Link to comment

whot is not correct !?

its my test script

[21:40:37] Starting mh1

[21:40:37] SCRIPT ERROR: ... sa/GTA San Andreas/Server/mods/deathmatch/resourcecache/mh1/manhunt.lua:2: or '...' expected near '391'

[21:40:37] INFO: Loading script failed: ... sa/GTA San Andreas/Server/mods/deathmatch/resourcecache/mh1/manhunt.lua:2: or '...' expected near '391'

function SpawnPlayer ( source, 391, 2548, 17 )

end

addEventHandler ( "onPlayerJoin", Spawnlayer )

-- when a player spawns,

function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension )

-- play a frontend sound for him

playSoundFrontEnd ( source, 16 )

end

-- add the player_Spawn function as a handler for onPlayerSpawn

addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn )

Link to comment

why when I start my resource firstly i have a black screen and 2 spawn in the map i need reconnect :?:

where is problem HELP!

function joinHandler()

local x = -1814

local y = -116

local z = 5.5

spawnPlayer(source, x, y, z)

fadeCamera(source, true)

setCameraTarget(source, source)

outputChatBox("manhunt born II kill", source)

end

addEventHandler("onPlayerJoin", getRootElement(), joinHandler)

-- when a player spawns,

function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension )

-- play a frontend sound for him

playSoundFrontEnd ( source, 16 )

end

-- add the player_Spawn function as a handler for onPlayerSpawn

addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn )

function playerDied(totalAmmo, killer, killerWeapon, bodypart)

outputChatBox(getClientName(source).." died!")

spawnPlayer ( source, -1859, -132.5, 12 )

end

addEventHandler("onPlayerWasted",getRootElement(),playerDied)

Link to comment
whot is not correct !?

its my test script

[21:40:37] Starting mh1

[21:40:37] SCRIPT ERROR: ... sa/GTA San Andreas/Server/mods/deathmatch/resourcecache/mh1/manhunt.lua:2: or '...' expected near '391'

[21:40:37] INFO: Loading script failed: ... sa/GTA San Andreas/Server/mods/deathmatch/resourcecache/mh1/manhunt.lua:2: or '...' expected near '391'

function SpawnPlayer ( source, 391, 2548, 17 )

end

addEventHandler ( "onPlayerJoin", Spawnlayer )

-- when a player spawns,

function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension )

-- play a frontend sound for him

playSoundFrontEnd ( source, 16 )

end

-- add the player_Spawn function as a handler for onPlayerSpawn

addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn )

lol @ red part..

Link to comment

TWO TEAMS [ Wanted and Hunter ]

in my script player with Survivor skin!

then if it is killed, he spawn with hunter skin!

but how can create really two teams (hunter,wanted) to play for points

because different spawn points it is not different teams, it is just different skin's and only =(

needs to create two teams, to be two opposing teams,and need create script to stop the Round at the last player from the [wanted team] , then the game will be meaningful !

who can help me in the development of this cool game mode !

and please, i know whot is MTA Development wiki, so dont put that links, useful site, but there are not many necessary things for my game mode

look at my script, and tell me where and what i need to put

and another question, look -> I go to the server -> I run this script -> He started -> I have a black screen -> then I need to do recconect -> and then I spawn .

Who knows how to fix this bug

my script ''manhunt.LUA''

function joinHandler()

local x = -1814

local y = -116

local z = 5.5

spawnPlayer(source, x, y, z)

fadeCamera(source, true)

setCameraTarget(source, source)

outputChatBox("manhunt born II kill", source)

end

addEventHandler("onPlayerJoin", getRootElement(), joinHandler)

-- when a player spawns,

function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension )

-- play a frontend sound for him

playSoundFrontEnd ( source, 16 )

addPlayerClothes ( source, "hoodjackbeige", "hoodjack", 0 )

addPlayerClothes ( source, "chinosb", "chinosbiege", 2 )

addPlayerClothes ( source, "conv", "convheatorn", 3 )

addPlayerClothes ( source, "balaclava", "balaclava", 17 )

setPlayerStat ( source, 22, 500 )

setPlayerStat ( source, 23, 999 )

giveWeapon ( source, 5, 1 )

giveWeapon ( source, 22, 999 )

setSkyGradient (255,77,0,213,64,0)

end

-- add the player_Spawn function as a handler for onPlayerSpawn

addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn )

function playerDied(totalAmmo, killer, killerWeapon, bodypart)

outputChatBox(getClientName(source).." died!")

spawnPlayer ( source, -1859, -132.5, 12 )

addPlayerClothes ( source, "highafro", "highafro", 1 )

addPlayerClothes ( source, "bask1", "timbergrey", 3 )

addPlayerClothes ( source, "countrytr", "countrytr", 17 )

addPlayerClothes ( source, "hockey", "hockeymask", 16 )

setPlayerStat ( source, 22, 999 )

setPlayerStat ( source, 23, 999 )

giveWeapon ( source, 9, 1 )

setSkyGradient (134,0,255,166,6,221)

end

addEventHandler("onPlayerWasted",getRootElement(),playerDied)

Thank you for your attention

Link to comment

Dude please copy all your code into a code format because it's really hard to read code unless it's formatted properly example:

  
 function onResourceStart() 
    players = getElementsByType ( "player" ) 
    for index, player in ipairs(players) do 
        spawnPlayer ( player, x, y, z ) 
        fadeCamera ( player, true ) 
    end 
 end 
addEventHandler ( "onResourceStart", getRootElement(), onResourceStart )  
  

is easier to read then:

function onResourceStart()

players = getElementsByType ( "player" )

for index, player in ipairs(players) do

spawnPlayer ( player, x, y, z )

fadeCamera ( player, true )

end

end

addEventHandler ( "onResourceStart", getRootElement(), onResourceStart )

use : [ c o d e = l u a ] --code here [ / c o d e]

without spaces..

BTW the function should help with one of your problems...

Link to comment

thanks [DKR]silverfang now the problem is solved with bug (black screen) !

can anyone help about development team (Wanted and Hunter) functions

functions such as : Score counting

list (of players) and information (score, of a team)

Round ends : 1) time ends, all Wanted team players are dead (Hunter team win)

2) last Survivor from Wanted team (Wanted team win)

this enough to make this game mode a full

I hope to help :wink:

Link to comment

As has been said, people will not make your gamemode for you, or large parts of it. That's not what this forum is for.

Look at the wiki and find functions and events that you can use. I'm thinking of the Team functions, the Text functions, setTimer for the time countdown, setElementData for score keeping, and getElementsByType to get a list of all players.

You also seem to be using the voting system to start your mode. In case you didn't know, you can use the console command "start yourresourcenamehere" to start it directly. ;)

Link to comment

Damn when I saw topic name, I had hopes...

But then... Anyways man arc_ is right. No one will help you piece to piece until you finish your script. At least not for free as far as I know. This is just spam on the forums, and there's bunch of topics that will already answer your questions.

Also I would advise you to learn to "read" scripts, not only to make them. You need to be able to snatch examples from others, and you can do that (especially how-to-make-good-looking-gui) by checking your X:\Program Files\MTA San Andreas\mods\deathmatch\resources

That's pretty good place to start "stealing" some examples.

Stop spamming and good luck, you'll need it.

Link to comment

dudes i'am not stuped and i take,stoll scripts from mta wiki and mta dm other game mode resources

but this is not enough to create its own game mode

I do not agree that my topic SPAM, TRASH

I gave a beta version of the script, and here I dont request to give me the finished game mode whits all scripts lua...xml... [-X

but senks for info about this things -> Team functions, Text functions, setTimer for the time countdown, setElementData for score keeping, and getElementsByType to get a list of all players.

Link to comment

Ok so someone isn't "stuped"... :lol:

Nvm. Listen dude, first you should learn English, 'cause I'm saying that you're asking us to follow your scripting process...

You think anyone would give you a finished script and give you all the credits?? You have very high thinking about yourself.

Most info is usually found on wiki, so before you posted this "stuped" thing you could simply check development.mtasa.com , and then come asking us about some problems you got on the way, not asking us piece by piece. There you could come by to next topics:

-http://development.mtasa.com/index.php?title=Server_Scripting_Functions#Team_functions or http://development.mtasa.com/index.php?title=Client_Scripting_Functions#Team_functions

-http://development.mtasa.com/index.php?title=Server_Scripting_Functions#Text_functions

-http://development.mtasa.com/index.php?title=SetTimer

-http://development.mtasa.com/index.php?title=GetElementData and http://development.mtasa.com/index.php?title=SetElementData

-http://development.mtasa.com/index.php?title=GetElementsByType

+ There you have a nice section called Example:

Wiki is like a bible for a scripter. if you wanna script, make sure it's always open.

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