Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → buying weapon
buying weapon
2002-01-05, 7:25 AM #1
this is supposed to make the player buy weapon when he activates a surface, if he has the money... why doesn't it work?

Code:
symbols

message	activated
message	startup

thing		player				   local
surface	mp5buy linkid=1
flex		mp5cost=20				   local

end

#-----------------------------------------------------------

code

startup: 

player = GetLocalPlayerThing();

#-------

activated:

if(GetSenderRef() == mp5buy);
{
 if(GetInv(player, 119) => mp5cost);
    {
     if(GetInv(player, 3) > 0) //already have the weapon?
       {
        SetInv(player, 116, 30);
        jkPrintUNIString(player, 116);
       }
    
     else
	 {
	 SetInv(player, 3, 1);
	 SetInv(player, 116, 30);
	 SetInv(player, 119, -20);
	 jkPrintUNIString(player, 3);
	 }
    }

 else
	jkPrintUNIString(player, 120);
}

	Return;

end


[This message has been edited by JediJigge (edited January 05, 2002).]
2002-01-05, 7:13 PM #2
You've got a crazy line there. It should be:

if(GetInv(player, 119) >= mp5cost);

I dont know if it fix it though.
Team Battle.
2002-01-05, 11:45 PM #3
Replace
If(GetSenderRef() == mp5buy)
with
if(GetSenderID() == 1)

------------------
Life is like... skating... yeah, skating is a good example. You see someone skating and think "Hey, that looks like fun and easy!". You go and buy a skateboard and try, you get a few broken bones, asphalt-face and stuff... But hey, i'm not the one who gets hurt!
Last edited by mb; today at 10:55 AM.
2002-01-06, 4:05 AM #4
Nope, still don't work...
2002-01-06, 4:36 AM #5
Oh, right... you need to use SetInvAvailable(); or something like that...

------------------
Life is like... skating... yeah, skating is a good example. You see someone skating and think "Hey, that looks like fun and easy!". You go and buy a skateboard and try, you get a few broken bones, asphalt-face and stuff... But hey, i'm not the one who gets hurt!
Last edited by mb; today at 10:55 AM.

↑ Up to the top!