wc3edit.net

United Warcraft 3 map hacking!
It is currently April 20th, 2024, 4:12 am

All times are UTC




Post new topic Reply to topic  [ 12 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: March 19th, 2007, 1:10 am 
Offline
Old Wrinkly Member
User avatar

Joined: March 7th, 2007, 7:04 am
Posts: 248
err... problems again - -a

Once i put -str, -agi and -int codes together like this..

Quote:
::Declare in globals::
trigger gg_trg_Str=null
trigger gg_trg_Agi=null
trigger gg_trg_Int=null
==========

-str part ===

function SetStr takes nothing returns nothing
call SetHeroStr(GetEnumUnit(),S2I(SubString(GetEventPlayerChatString(),4,20)),true)
endfunction

function HerosOnly takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==true)
endfunction

function Trig_Str_Actions takes nothing returns nothing
local player p=GetTriggerPlayer()
local group g=CreateGroup()
call GroupEnumUnitsOfPlayer(g,p,Condition(function HerosOnly))
call ForGroup(g,function SetStr)
call DestroyGroup(g)
set g=null
endfunction

function InitTrig_Str takes nothing returns nothing
set gg_trg_Str = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(0), "-str", false )
call TriggerAddAction( gg_trg_Str, function Trig_Str_Actions )
endfunction

-agi part ===

function SetAgi takes nothing returns nothing
call SetHeroAgi(GetEnumUnit(),S2I(SubString(GetEventPlayerChatString(),4,20)),true)
endfunction

function HerosOnly takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==true)
endfunction

function Trig_Agi_Actions takes nothing returns nothing
local player p=GetTriggerPlayer()
local group g=CreateGroup()
call GroupEnumUnitsOfPlayer(g,p,Condition(function HerosOnly))
call ForGroup(g,function SetAgi)
call DestroyGroup(g)
set g=null
endfunction

function InitTrig_Agi takes nothing returns nothing
set gg_trg_Agi = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Agi, Player(0), "-agi", false )
call TriggerAddAction( gg_trg_Agi, function Trig_Agi_Actions )
endfunction

-int part ===

function SetInt takes nothing returns nothing
call SetHeroInt(GetEnumUnit(),S2I(SubString(GetEventPlayerChatString(),4,20)),true)
endfunction

function HerosOnly takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==true)
endfunction

function Trig_Int_Actions takes nothing returns nothing
local player p=GetTriggerPlayer()
local group g=CreateGroup()
call GroupEnumUnitsOfPlayer(g,p,Condition(function HerosOnly))
call ForGroup(g,function SetInt)
call DestroyGroup(g)
set g=null
endfunction

function InitTrig_Int takes nothing returns nothing
set gg_trg_Int = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Int, Player(0), "-int", false )
call TriggerAddAction( gg_trg_Int, function Trig_Int_Actions )
endfunction

::In function main::
call InitTrig_Str()
call InitTrig_Agi()
call InitTrig_Int()
==========


It said "the map was not found" when i create the game..

But it will works if i only put -str code only.. so weird eh :?

Oh btw, i just want only player red "player (0)" (host) can cheat. So, i delete the othe player lines.

_________________
Image

The tallest tower.. begins from the ground
Today, you are novice..
Tomorrow, you might be The Master..
And when you are..
Vosszaa will hunt you down..


Top
 Profile  
 
 Post subject:
PostPosted: March 19th, 2007, 2:24 am 
Offline
Forum Staff
User avatar

Joined: January 28th, 2007, 8:10 pm
Posts: 830
Location: Canada
Title: JASS Programmer
Quote:
It's because you have the "function HerosOnly" 3 times which is an error, you only need to declare it once

I took the liberty of merging your functions too...how nice ^.^

trigger gg_trg_Stats=null

function HerosOnly takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==true)
endfunction
function SetStr takes nothing returns nothing
call SetHeroStr(GetEnumUnit(),S2I(SubString(GetEventPlayerChatString(),4,20)),true)
endfunction
function SetAgi takes nothing returns nothing
call SetHeroAgi(GetEnumUnit(),S2I(SubString(GetEventPlayerChatString(),4,20)),true)
endfunction
function SetInt takes nothing returns nothing
call SetHeroInt(GetEnumUnit(),S2I(SubString(GetEventPlayerChatString(),4,20)),true)
endfunction

function SetStats takes nothing returns nothing
local group g=CreateGroup()
local string s=SubString(GetEventPlayerChatString(),0,4)
call GroupEnumUnitsOfPlayer(g,GetTriggerPlayer(),Condition(function HerosOnly))
call DestroyBoolExpr(Condition(function HerosOnly))
if s=="-str" then
call ForGroup(g,function SetStr)
endif
if s=="-agi" then
call ForGroup(g,function SetAgi)
endif
if s=="-int" then
call ForGroup(g,function SetInt)
endif
call DestroyGroup(g)
set g=null
endfunction

function InitTrig_Stats takes nothing returns nothing
set gg_trg_Stats=CreateTrigger()
call TriggerRegisterPlayerChatEvent(gg_trg_Stats,Player(0),"-str",false)
call TriggerRegisterPlayerChatEvent(gg_trg_Stats,Player(0),"-agi",false)
call TriggerRegisterPlayerChatEvent(gg_trg_Stats,Player(0),"-int",false)
call TriggerAddAction(gg_trg_Stats,function SetStats)
endfunction

call InitTrig_Stats()


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)