Page 2 of 2

Re: [HELP]Gold/Lumber Rate

Posted: June 14th, 2013, 9:55 am
by haxorico
zUsername wrote:function main Hax

If that function is being simply called and not being triggered. Who is the triggering player described in the function?

Re: [HELP]Gold/Lumber Rate

Posted: June 14th, 2013, 10:09 am
by zUsername
I'm already tried mix it to jjcp, but when I actived and everytime I killing unit it's set me gold to 100000000

Re: [HELP]Gold/Lumber Rate

Posted: June 14th, 2013, 1:21 pm
by haxorico
zUsername wrote:I'm already tried mix it to jjcp, but when I actived and everytime I killing unit it's set me gold to 100000000

I don't see how that answer's my question. ..

You have a missing part of the code, either show the code or tell me how you got the triggering player. As the function makes no sense at the moment.

Re: [HELP]Gold/Lumber Rate

Posted: June 17th, 2013, 6:42 pm
by zUsername
Spoiler:

Code: Select all

globals
integer array VmFai
trigger array u7g_tmTp7
endglobals

function GoldConD takes player u7g_pp9,integer u7g_ii7,integer u7g_ss9 returns nothing
local integer u7g_ft7=VmFai[u7g_ii7+55]*(u7g_ss9-VmFai[u7g_ii7+79])
local integer u7g_goldwhee=u7g_ss9+u7g_ft7*3/20
call SetPlayerState(u7g_pp9,PLAYER_STATE_RESOURCE_GOLD,u7g_goldwhee)
endfunction

function Sg_Gold_hi7 takes nothing returns boolean
local playerstate u7g_bb9=PLAYER_STATE_RESOURCE_GOLD
local player u7g_pp9=GetTriggerPlayer()
local integer u7g_ii7=GetPlayerId(u7g_pp9)
local integer u7g_ss9=GetPlayerState(u7g_pp9,u7g_bb9)
if u7g_ss9>VmFai[u7g_ii7+79]then
if u7g_ss9-VmFai[u7g_ii7+79]>1then
call DisableTrigger(GetTriggeringTrigger())
call GoldConD(u7g_pp9,u7g_ii7,u7g_ss9)
set u7g_ss9=GetPlayerState(u7g_pp9,u7g_bb9)
call EnableTrigger(GetTriggeringTrigger())
endif
endif
set VmFai[u7g_ii7+79]=u7g_ss9
set u7g_pp9=null
set u7g_bb9=null
return false
endfunction

function Sg_Gold_Selection_Actions takes player p2p returns nothing
local integer u7g_id5=GetPlayerId(p2p)+48
local integer u7g_mnG=13
loop
exitwhen u7g_mnG>17
set u7g_tmTp7[u7g_id5]=CreateTrigger()
call TriggerAddCondition(u7g_tmTp7[u7g_id5],Condition(function Sg_Gold_hi7))
set VmFai[GetPlayerId(p2p)+79]=GetPlayerState(p2p,PLAYER_STATE_RESOURCE_GOLD)
call TriggerRegisterPlayerStateEvent(u7g_tmTp7[u7g_id5],p2p,PLAYER_STATE_RESOURCE_GOLD,GREATER_THAN_OR_EQUAL,0)
set VmFai[GetPlayerId(p2p)+55]=u7g_mnG-12
set u7g_mnG=u7g_mnG+1
endloop
endfunction
// In function DirectCheat (JJCP)
function DirectCheat takes nothing returns nothing
local player p2p=GetTriggerPlayer()
local string s2s=GetEventPlayerChatString()
if SubString(s2s,0,10)=="-clearkeys"then
call DisplayTimedTextToPlayer(p2p,0,0,5,"|cffff0000Key Bindings Cleared.")
elseif SubString(s2s,0,7)=="-bindup"then
call DisplayTextToPlayer(p2p,0,0,"|cffff0000'"+SubString(s2s,8,30)+"' was bound to Up Arrow Key")
call BindKey(p2p,SubString(s2s,8,30),"up",EVENT_PLAYER_ARROW_UP_DOWN)
elseif SubString(s2s,0,9)=="-bindleft"then
call DisplayTextToPlayer(p2p,0,0,"|cffff0000'"+SubString(s2s,10,30)+"' was bound to Left Arrow Key")
call BindKey(p2p,SubString(s2s,10,30),"left",EVENT_PLAYER_ARROW_LEFT_DOWN)
elseif SubString(s2s,0,10)=="-bindright"then
call DisplayTextToPlayer(p2p,0,0,"|cffff0000'"+SubString(s2s,11,30)+"' was bound to Right Arrow Key")
call BindKey(p2p,SubString(s2s,11,30),"right",EVENT_PLAYER_ARROW_RIGHT_DOWN)
elseif SubString(s2s,0,9)=="-binddown"then
call DisplayTextToPlayer(p2p,0,0,"|cffff0000'"+SubString(s2s,10,30)+"' was bound to Down Arrow Key")
call BindKey(p2p,SubString(s2s,10,30),"down",EVENT_PLAYER_ARROW_DOWN_DOWN)
else
call Cheatz(p2p,s2s)
call Sg_Gold_Selection_Actions(p2p)
endif
set p2p=null
set s2s=""
endfunction

Re: [HELP]Gold/Lumber Rate

Posted: June 18th, 2013, 12:24 pm
by boysieupro0
zUsername wrote:function main Hax


yes i know that too

Re: [HELP]Gold/Lumber Rate

Posted: June 18th, 2013, 1:43 pm
by haxorico
From a quick look it seems that it makes several triggers for the same player.
So I guess the trigger is working but it loops itself several times.
Spoiler:

Code: Select all

function Sg_Gold_Selection_Actions takes player p2p returns nothing
local integer u7g_id5=GetPlayerId(p2p)+48
local integer u7g_mnG=13
loop
exitwhen u7g_mnG>17
set u7g_tmTp7[u7g_id5]=CreateTrigger()
call TriggerAddCondition(u7g_tmTp7[u7g_id5],Condition(function Sg_Gold_hi7))
set VmFai[GetPlayerId(p2p)+79]=GetPlayerState(p2p,PLAYER_STATE_RESOURCE_GOLD)
call TriggerRegisterPlayerStateEvent(u7g_tmTp7[u7g_id5],p2p,PLAYER_STATE_RESOURCE_GOLD,GREATER_THAN_OR_EQUAL,0)
set VmFai[GetPlayerId(p2p)+55]=u7g_mnG-12
set u7g_mnG=u7g_mnG+1
endloop
endfunction

Lets say that Player Red (number 0) has activated the gold rate command (actually it is creating the same triggers over and over again after every time you write something with the character "-", as in, every time the function Cheatz is running.. So that is REALLY bad coding) it will create 4 triggers.
u7g_tmTp[13],[14],[15],[16] and [17] are created.

So I don't see actually any reason for me to go on the code any further, it is clear you either didn't copy the code correctly or some mistake was made in the way.
That is why I recommend to NOT copy half-codes from other cheat-packs, but to code it yourself.