Set a variable to true with Call Remote Function
#1

Hello all!
Well, I've searched and not found anything.
I have a boolean in one script, and I want to set it true in another script, using Call Remote Function:
pawn Код:
new bool: logged[MAX_PLAYERS];

forward LoggedCall(playerid);
public LoggedCall(playerid)
{
       return logged[playerid];
}

//In another script, I need to turn on this boolean
CallRemoteFunction("LoggedCall", "i", playerid) = true;
But it isn't working, I get an error in this line:
pawn Код:
error 022: must be lvalue (non-constant)
How to fix this?
Thanks all in advance!
Reply
#2

Quote:
Originally Posted by YwX
Посмотреть сообщение
Hello all!
Well, I've searched and not found anything.
I have a boolean in one script, and I want to set it true in another script, using Call Remote Function:
pawn Код:
new bool: logged[MAX_PLAYERS];

forward LoggedCall(playerid);
public LoggedCall(playerid)
{
       return logged[playerid];
}

//In another script, I need to turn on this boolean
CallRemoteFunction("LoggedCall", "i", playerid) = true;
But it isn't working, I get an error in this line:
pawn Код:
error 022: must be lvalue (non-constant)
How to fix this?
Thanks all in advance!
Try this.
pawn Код:
new
    logged[ playerid ];

forward LoggedCall( playerid, condition );
public LoggedCall( playerid, condition )
    return logged[ playerid ] = condition;

// In another script
CallRemoteFunction( "LoggedCall", "ii", playerid, condition );
NOTE: No booleans, it's set default as an integer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)