ID:178894
 
Ok im making a new game and when someone subscribes i want it to be that they can have up to 3 people. Im using Deadron's Charactor Handling. This is what i tried first

if(client.CheckPassport("14c8ef3b6d40a1fc"))

client/base_num_characters_allowed = 3

return ..()

else

client/base_num_characters_allowed = 1

return ..()

These are the errors i got.

Saving1.dm:94:error:"14c8ef3b6d40a1fc":value not allowed here
Saving1.dm:94:error:client.CheckPassport:instruction not allowed here
Saving1.dm:94:error::empty type name (indentation error?)
Saving1.dm:96:error:..:instruction not allowed here
Saving1.dm:96:error:return :instruction not allowed here
Saving1.dm:98:error:base_num_characters_allowed:undefined var
Saving1.dm:96:error::empty type name (indentation error?)
Saving1.dm:102:error:base_num_characters_allowed:undefined var
Saving1.dm:104:error:..:instruction not allowed here
Saving1.dm:104:error:return :instruction not allowed here

So i decided after a while maybe if i put it in a Login code.


mob/Login()
if(client.CheckPassport("14c8ef3b6d40a1fc"))

return ..()

client/base_num_characters_allowed = 3

else

client/base_num_characters_allowed = 1

return ..()

and i got these errors.

Saving1.dm:99:error:client/ base_num_characters_allowed:undefined var
Saving1.dm:103:error:client/ base_num_characters_allowed:undefined var

Now im stumped Please help ^_^

--[dbz73]--
--[Not a dbz game maker]--

It looks to me like this problem would be clearer if we could tell where those statements were--which procs are they in, and under which type (client.New(), mob.Login()...)?
If you could show us the whole proc, and the other info to go with it (saying it belongs to the mob or the client or such), it would help a lot.

Lummox JR
In response to Lummox JR
the orriginal client/base_num_characters_allowed was by itself like that.
In response to dbz73
I think I see what you're saying now. If you mean the if() is freestanding and not within a proc, I'm gonna have to jump in with a "Duh!" You can't use regular statements like that outside of a proc. No wonder it gave you so many errors. If you want code like that to occur at world login, put it in world.New(). If you want it at client creation, use client.New().

Now, the second set of errors (which was also present in the original) comes from a major syntax blunder that I didn't notice before: You're using client/base_num_characters_allowed instead of client.base_num_characters_allowed to set the value. The slash doesn't mean anything in this context, and you're confusing the compiler. (C would give you an equally nebulous error, telling you that client/base_num_characters_allowed is not an Lvalue, because it would interpret the slash as division. DM apparently realized that nothing at all made sense there as a use for the slash.)

Lummox JR
In response to Lummox JR
lol i figured that out already, thanks for your help =)