bool's is bugging.
#1

gello, i creating my new server, in server i have dini register system, no more systems, or scripts..

i type:
new bool:test[MAX_PLAYERS];

onplayercommandtext:

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/check", cmdtext, true, 10) == 0)
    {
        if(test[playerid] == true){
            SendClientMessage(playerid, GREEN,"in bool");}
        else if(test[playerid] == false){
            SendClientMessage(playerid, GREEN,"not in bool");}

        return 1;
    }
    if (strcmp("/inbool", cmdtext, true, 10) == 0)
    {
        test[playerid] = true;
        return 1;
    }
    if (strcmp("/outbool", cmdtext, true, 10) == 0)
    {
        test[playerid] = false;
        return 1;
    }
    return 0;
}
and i start server, when i spawn, first y type /check command, and for me send message "in bool" whyy??

ant when y type /outbool , and type /check server sends me message: "in bool" the hell is bugging? i understand?
Reply
#2

Two sets of variables:
pawn Code:
test[playerid]

tikrinu[playerid]
Reply
#3

Quote:
Originally Posted by smeti
View Post
Two sets of variables:
pawn Code:
test[playerid]

tikrinu[playerid]
sorry, i'm fot lithuanian, and translated in eng lang.
Reply
#4

That doesn't explain why the 'true' part is triggered. Newly created booleans are always set to false unless explicitly initialized to true.
Reply
#5

#include <a_samp>

new bool:tikrinu[MAX_PLAYERS];
#define GREEN 0x00C2ECFF
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}



public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/tikrinu", cmdtext, true, 10) == 0)
{
if(tikrinu[playerid] == true){
SendClientMessage(playerid, GREEN,"in bool");}
else if(tikrinu[playerid] == false){
SendClientMessage(playerid, GREEN,"not in bool");}

return 1;
}
if (strcmp("/inbool", cmdtext, true, 10) == 0)
{
tikrinu[playerid] = true;
return 1;
}
if (strcmp("/outbool", cmdtext, true, 10) == 0)
{
tikrinu[playerid] = false;
return 1;
}
return 0;
}

and still server saying that i'am in bool if I type /outbool cmd..
Reply
#6

Quote:
Originally Posted by Vince
View Post
That doesn't explain why the 'true' part is triggered. Newly created booleans are always set to false unless explicitly initialized to true.
i understand, but when I restart server and first i type/check and server saying i'm in bool.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)