Hey Umm my friend made a trigger for me and he said that instead of putting it in w3 and going threw all of that mess take a code so the code was
JASS:Copy
function Trig_Give_Gold_Conditions takes nothing returns boolean
if ( not ( GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD) >= S2I(SubStringBJ(GetEventPlayerChatString(), 9, 1000000000)) ) ) then
return false
endif
return true
endfunction
function Trig_Give_Gold_Actions takes nothing returns nothing
call SetPlayerStateBJ( GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD, ( GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD) - S2I(SubStringBJ(GetEventPlayerChatString(), 9, 1000000000)) ) )
call SetPlayerStateBJ( ConvertedPlayer(S2I(SubStringBJ(GetEventPlayerChatString(), 6, 7))), PLAYER_STATE_RESOURCE_GOLD, ( GetPlayerState(ConvertedPlayer(S2I(SubStringBJ(GetEventPlayerChatString(), 6, 7))), PLAYER_STATE_RESOURCE_GOLD) + S2I(SubStringBJ(GetEventPlayerChatString(), 9, 1000000000)) ) )
call DisplayTextToForce( GetForceOfPlayer(ConvertedPlayer(S2I(SubStringBJ(GetEventPlayerChatString(), 6, 7)))), ( udg_PlayerName[GetConvertedPlayerId(GetTriggerPlayer())] + ( "has given you |cffffcc00" + ( SubStringBJ(GetEventPlayerChatString(), 9, 1000000000) + "|r gold." ) ) ) )
endfunction
//===========================================================================
function InitTrig_Give_Gold takes nothing returns nothing
set gg_trg_Give_Gold = CreateTrigger( )
call TriggerAddCondition( gg_trg_Give_Gold, Condition( function Trig_Give_Gold_Conditions ) )
call TriggerAddAction( gg_trg_Give_Gold, function Trig_Give_Gold_Actions )
endfunction
so i saved it as in jass and it turned into
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil Courier New;}}
{\colortbl ;\red0\green0\blue0;\red0\green136\blue204;\red0\green0\blue128;\red128\green0\blue0;\red0\green0\blue255;\red120\green120\blue120;}
\viewkind4\uc1\pard\cf1\b\f0\fs18 function\b0 Trig_Give_Gold_Conditions \b takes\b0 \cf2 nothing\cf1 \b returns\b0 \cf2 boolean\cf1
\par \b if\b0 \b (\b0 \cf3 not\cf1 \b (\b0 \cf3 GetPlayerState\cf1\b (\cf3\b0 GetTriggerPlayer\cf1\b ()\b0 , \cf4 PLAYER_STATE_RESOURCE_GOLD\cf1\b )\b0 \cf3 >=\cf1 \cf3 S2I\cf1\b (\cf3\b0 SubStringBJ\cf1\b (\cf3\b0 GetEventPlayerChatString\cf1\b ()\b0 , \cf3 9\cf1 , \cf3 1000000000\cf1\b ))\b0 \b )\b0 \b )\b0 \b then\b0
\par \cf3 return\cf1 \cf4 false\cf1
\par \b endif\b0
\par \cf3 return\cf1 \cf4 true\cf1
\par \b endfunction\b0
\par
\par \b function\b0 Trig_Give_Gold_Actions \b takes\b0 \cf2 nothing\cf1 \b returns\b0 \cf2 nothing\cf1
\par \cf3 call\cf1 \cf3 SetPlayerStateBJ\cf1\b (\b0 \cf3 GetTriggerPlayer\cf1\b ()\b0 , \cf4 PLAYER_STATE_RESOURCE_GOLD\cf1 , \b (\b0 \cf3 GetPlayerState\cf1\b (\cf3\b0 GetTriggerPlayer\cf1\b ()\b0 , \cf4 PLAYER_STATE_RESOURCE_GOLD\cf1\b )\b0 \cf3 -\cf1 \cf3 S2I\cf1\b (\cf3\b0 SubStringBJ\cf1\b (\cf3\b0 GetEventPlayerChatString\cf1\b ()\b0 , \cf3 9\cf1 , \cf3 1000000000\cf1\b ))\b0 \b )\b0 \b )\b0
\par \cf3 call\cf1 \cf3 SetPlayerStateBJ\cf1\b (\b0 \cf3 ConvertedPlayer\cf1\b (\cf3\b0 S2I\cf1\b (\cf3\b0 SubStringBJ\cf1\b (\cf3\b0 GetEventPlayerChatString\cf1\b ()\b0 , \cf3 6\cf1 , \cf3 7\cf1\b )))\b0 , \cf4 PLAYER_STATE_RESOURCE_GOLD\cf1 , \b (\b0 \cf3 GetPlayerState\cf1\b (\cf3\b0 ConvertedPlayer\cf1\b (\cf3\b0 S2I\cf1\b (\cf3\b0 SubStringBJ\cf1\b (\cf3\b0 GetEventPlayerChatString\cf1\b ()\b0 , \cf3 6\cf1 , \cf3 7\cf1\b )))\b0 , \cf4 PLAYER_STATE_RESOURCE_GOLD\cf1\b )\b0 \cf3 +\cf1 \cf3 S2I\cf1\b (\cf3\b0 SubStringBJ\cf1\b (\cf3\b0 GetEventPlayerChatString\cf1\b ()\b0 , \cf3 9\cf1 , \cf3 1000000000\cf1\b ))\b0 \b )\b0 \b )\b0
\par \cf3 call\cf1 \cf3 DisplayTextToForce\cf1\b (\b0 \cf3 GetForceOfPlayer\cf1\b (\cf3\b0 ConvertedPlayer\cf1\b (\cf3\b0 S2I\cf1\b (\cf3\b0 SubStringBJ\cf1\b (\cf3\b0 GetEventPlayerChatString\cf1\b ()\b0 , \cf3 6\cf1 , \cf3 7\cf1\b ))))\b0 , \b (\b0 udg_PlayerName\b [\cf3\b0 GetConvertedPlayerId\cf1\b (\cf3\b0 GetTriggerPlayer\cf1\b ())]\b0 \cf3 +\cf1 \b (\b0 \cf5\i "has\cf1\i0 \cf5\i given\cf1\i0 \cf5\i you\cf1\i0 \cf5\i |cffffcc00"\cf1\i0 \cf3 +\cf1 \b (\b0 \cf3 SubStringBJ\cf1\b (\cf3\b0 GetEventPlayerChatString\cf1\b ()\b0 , \cf3 9\cf1 , \cf3 1000000000\cf1\b )\b0 \cf3 +\cf1 \cf5\i "|r\cf1\i0 \cf5\i gold."\cf1\i0 \cf5\i )\cf1\i0 \cf5\i )\cf1\i0 \cf5\i )\cf1\i0 \cf5\i )\cf1\i0
\par \b endfunction\b0
\par
\par \cf6\i //===========================================================================\cf1\i0
\par \b function\b0 InitTrig_Give_Gold \b takes\b0 \cf2 nothing\cf1 \b returns\b0 \cf2 nothing\cf1
\par \cf3 set\cf1 gg_trg_Give_Gold \cf3 =\cf1 \cf3 CreateTrigger\cf1\b (\b0 \b )\b0
\par \cf3 call\cf1 \cf3 TriggerAddCondition\cf1\b (\b0 gg_trg_Give_Gold, \cf3 Condition\cf1\b (\b0 \b function\b0 Trig_Give_Gold_Conditions \b )\b0 \b )\b0
\par \cf3 call\cf1 \cf3 TriggerAddAction\cf1\b (\b0 gg_trg_Give_Gold, \b function\b0 Trig_Give_Gold_Actions \b )\b0
\par \b endfunction\cf0\b0
\par }
is that correct?? i put it into a new trigger so that is the whole trigger.
Is this correct?
THanks