Variable isn't getting called
#1

Hey,

Basicly when you register you've entered a name.
This name is mname.
When you register (checked it with printf) it enters the correct name into the correct value position.

Altough when you log back in, you get nothing.

This is the line where the variable should get called back into the script:

Quote:

if( strcmp( key , "mname" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][mname] = strmid(PlayerInfo[playerid][mname], val, 0, 32); }

But as I said, it gives nothing.
Also printf shows me nothing here.
Reply
#2

Could be a problem with how your using strmid. Are you sure "val" has a value?
Reply
#3

Not sure...
Quote:

if( strcmp( key , "city" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][city] = strval( val ); }

Is pretty much the same and does work, however it has a strval (val).

This login thing is an ordinary and much used callback which you can find in a lot of scripts..
I just tried to add 2 more things to it
Reply
#4

In that first code, add printf("%s", val); and see if it prints anything.
Reply
#5

Spams me under with all kind of variables (which do excist).
This is so because in the onplayerlogin everything is defined with val.
Reply
#6

Try this and see what it prints.
pawn Код:
if( strcmp( key , "mname" , true ) == 0 )
{
    val = ini_GetValue( Data );
    PlayerInfo[playerid][mname] = strmid(PlayerInfo[playerid][mname], val, 0, 32);
    printf("%s", val); //Right Here
}
Reply
#7

Quote:

[21:29:32] (ONPLAYERLOG)Mname: 0

[21:29:32] (ONPLAYERLOG)Mname: 0

[21:29:32] (ONPLAYERLOG)Mname: 0.0

[21:29:32] (ONPLAYERLOG)Mname: 0.0

[21:29:32] (ONPLAYERLOG)Mname: 0.0

[21:29:32] (ONPLAYERLOG)Mname: 0

[21:29:32] (ONPLAYERLOG)Mname: 0

[21:29:32] (ONPLAYERLOG)Mname: 0

[21:29:32] Chris

[21:29:32] (ONPLAYERLOG)Mname: Chris

[21:29:32] (ONPLAYERLOG)Mname: 2

[21:29:32] (ONPLAYERLOG)Mname: 4

[21:29:32] (ONPLAYERLOG)Mname: 330390

Thats the part of my server log.
Obviously "Chris" was supposed to be the correct one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)