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

[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:
Level 19
Joined
Aug 8, 2007
Messages
2,765
You need to use JNGP. JassCraft uses JNGP's JassHelper (a form of it) by default
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
"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.
Top