Scripting issue
#2

Quote:
Originally Posted by Sarra
Посмотреть сообщение
(I'm a Beginner, so I might say stupid things, I started learning pawno 1 day ago)
I made a /whereismech command that creates a checkpoint at the mechanic place, I also added a boolean(false) that gets a (true) after using the checkpoint command, so the player will need to /deletecheckpoint to have another
Everything works fine, that's what I thought in the beginning. It does actually but only if there's 1 player in the server, when there are 2 players if one of them uses /whereismech , a checkpoint will appear, and the boolean will change to (true) so he won't be able to /whereismech again before using /deletecheckpoint or touching the checkpoint, the second player also can't use /whereismech since the boolean contains true already , because the first player used the /whereismech command: I wish you get the point guys.
Code
pawn Код:
new bool:Bo=false;

pawn Код:
if (strcmp(cmdtext, "/whereismech", true) == 0)
    {
        if (Bo == true) return SendClientMessage(playerid, 0xFF0000AA, "You already have an active Checkpoint, please use /deletecheckpoint to have another one");
        else
        {
        if (!IsPlayerInRangeOfPoint(playerid, 5, 1607.2327, -1841.8683, 13.5116))
        {
            SetPlayerCheckpoint(playerid, 1607.2327, -1841.8683, 13.5116, 3);
            SendClientMessage (playerid, 0xFF0000AA, "Go to the checkpoint and /repair there");
            Bo=true;
            return 1;
        }
        else
        {
        SendClientMessage(playerid, 0xFF0000AA, "You are already in the mechanic place, use /repair, this will cost you 5000$");
        return 1;
        }
        }
       
    }

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
DisablePlayerCheckpoint(playerid);
PlayerPlaySound(playerid, 1139, 0.0, 0.0, 0.0);
Bo=false;
return 1;
}
Any Idea? How Can I fix it so the boolean doesn't change for everyone, only for the player who has used the command
hmm i dont get the problem but anyway put under OnPlayerConnect Bo = 0; this will set the Boolean to false when a player connects and go to each cmd u made that makes a checkpoint and put the bo get me?
Edit: Where are you from?
Reply


Messages In This Thread
Scripting issue - by Sarra - 02.08.2014, 04:58
Re: Scripting issue - by youssefehab500 - 02.08.2014, 05:03
Re: Scripting issue - by Sarra - 02.08.2014, 05:14
Re: Scripting issue - by youssefehab500 - 02.08.2014, 05:18
Re: Scripting issue - by IceBilizard - 02.08.2014, 05:18
Re: Scripting issue - by Cannary2048 - 02.08.2014, 05:19
Re: Scripting issue - by Sarra - 02.08.2014, 05:23

Forum Jump:


Users browsing this thread: 2 Guest(s)