ok here's my cog. and the problem with it is that NOTHING happens ingame can someone help me with it?
# Jedi Knight Cog Script
# trade.cog
#
# This cog will play one unistring then play a sound at the activator pos, check if the player has enough credits if he does then it will
# create an object at a ghost posistion
# Activator is thing that has to be activated for cog to work
# GhostPos is the place where the bought item will be placed
# Purchase is the template of the bought item
# SpeakSound is the voice that will be played at the Activator
# SndFlags are the sound flags (don't know what this is)
# Cost is the cost of the item being purchased
# Unistring1 is the string that tells you what the activators offering and for what price
# Unistring2 is the string that is printed after you have done buisness with the activator
# Unistring3 is the string that tells you you don't have enough credits
# VolFlex is the Volume Flex (don't know what this is either)
# MinSndDist is the minimum sound range of the SpeakSound
# MaxSndDist is the maximum sound range of the SpeakSound
#
# By: JK2k_Avenger
# This Cog is Not supported by LucasArts Entertainment Co
symbols
Thing Activator
Thing GhostPos
Template Purchase
Sound SpeakSound
Int Player Local
Int Inuse Local
Int HeardOnce Local
Int CheckCash Local
Int SndFlags
Flex Cost
Flex Unistring1
Flex Unistring2
Flex Unistring3
Flex VolFlex
Flex MinSndDist
Flex MaxSndDist
Message Activated
end
# ========================================================================================
code
# ========================================================================================
Activated
If(Inuse == 1) Return; //checks if someone is speaking to the Activator
Inuse=1;
PlaySoundThing(SpeakSound, Activator, VolFlex, MinSndDist, MaxSndDist, SndFlags); //plays Activator's voice
If(HeardOnce == 0) JKPrintUnistring(player, Unistring1); //if the player has not heard the deal then it will print it out
HeardOnce = 1;
CheckCash=GetInv(player, 40);
If(CheckCash => Cost) JKPrintUnistring(player, Unistring3); //if the cash is less than the cost then print unistring 3
If(CheckCash => Cost) Return;
ChangeInv(Player, 40, -Cost);
JKPrintUnistring(player, Unistring2)
CreateThing(Purchase, GhostPos);
Inuse=0;
return;
# ........................................................................................
end
# Jedi Knight Cog Script
# trade.cog
#
# This cog will play one unistring then play a sound at the activator pos, check if the player has enough credits if he does then it will
# create an object at a ghost posistion
# Activator is thing that has to be activated for cog to work
# GhostPos is the place where the bought item will be placed
# Purchase is the template of the bought item
# SpeakSound is the voice that will be played at the Activator
# SndFlags are the sound flags (don't know what this is)
# Cost is the cost of the item being purchased
# Unistring1 is the string that tells you what the activators offering and for what price
# Unistring2 is the string that is printed after you have done buisness with the activator
# Unistring3 is the string that tells you you don't have enough credits
# VolFlex is the Volume Flex (don't know what this is either)
# MinSndDist is the minimum sound range of the SpeakSound
# MaxSndDist is the maximum sound range of the SpeakSound
#
# By: JK2k_Avenger
# This Cog is Not supported by LucasArts Entertainment Co
symbols
Thing Activator
Thing GhostPos
Template Purchase
Sound SpeakSound
Int Player Local
Int Inuse Local
Int HeardOnce Local
Int CheckCash Local
Int SndFlags
Flex Cost
Flex Unistring1
Flex Unistring2
Flex Unistring3
Flex VolFlex
Flex MinSndDist
Flex MaxSndDist
Message Activated
end
# ========================================================================================
code
# ========================================================================================
Activated
If(Inuse == 1) Return; //checks if someone is speaking to the Activator
Inuse=1;
PlaySoundThing(SpeakSound, Activator, VolFlex, MinSndDist, MaxSndDist, SndFlags); //plays Activator's voice
If(HeardOnce == 0) JKPrintUnistring(player, Unistring1); //if the player has not heard the deal then it will print it out
HeardOnce = 1;
CheckCash=GetInv(player, 40);
If(CheckCash => Cost) JKPrintUnistring(player, Unistring3); //if the cash is less than the cost then print unistring 3
If(CheckCash => Cost) Return;
ChangeInv(Player, 40, -Cost);
JKPrintUnistring(player, Unistring2)
CreateThing(Purchase, GhostPos);
Inuse=0;
return;
# ........................................................................................
end
Join JK2k on the zone! go to http://www.jk2k.8k.com