• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[JASS] One Player Game End

Status
Not open for further replies.
Level 9
Joined
Apr 23, 2011
Messages
460
I was wondering what is wrong with the script. I used Jasscraft to write it, and it parsed successfully, but WE won't let it go, it says that it expected a name in the first function and several other errors. Any Ideas?
JASS:
function GetPlayerCount takes nothing returns integer
local integer count = CountPlayersInForceBJ(udg_Players_Group)
return count
endfunction

function IsOnePlayer takes nothing returns boolean
    if ( not ( GetPlayerCount() == 1 ) ) then
        return false
    endif
return true
endfunction

function PlayerIsOne takes nothing returns nothing
local player p
    if IsOnePlayer() then
        set p = ForcePickRandomPlayer(udg_Players_Group)
        call CustomDefeatBJ(p,"One player not allowed")
    endif
set p = null
endfunction

function InitTrig_One_Player_Game takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerAddAction(t,function PlayerIsOne)
call TriggerRegisterTimerEventPeriodic(t,1)
set t = null
endfunction

edit: fixed indenting for script to be "prettier".
 
Last edited:
"Expected a Name'" is a common error when you use a vJass script without JassHelper, but i can't tell anything else besides horrible indenting
 
Status
Not open for further replies.
Back
Top