[Tutorial] Use bool variables: It's easy.
#1

Hello.

Some NOT use bool variable which is quite a shame.

To fast they can afford to pass a variable to true or false state for different systems as an OOC channel on the roleplay server etc.

Let's get into the nitty-gritty, how is a bool variable?

It looks like this:
(In theory variables like that are global.)

pawn Code:
new bool:Easy;
You can boot to a command or server start that this variable is the state as true or false:

pawn Code:
Easy = true;
Easy = false;
From it you can quickly make an order, here's a quick example very concrete:

pawn Code:
if(strcmp(cmd, "/command", true) == 0)
{
    if(Easy == false)
    {
        SendClientMessage(playerid, -1, "You just activate your system variable is set to true.");
        Easy = true;
    }
    else
    {
        SendClientMessage(playerid, -1, "You just disable your system variable is set to false.");
        Easy = false;
    }
    return 1;
}
As you can see it is very simple to use and it can be really useful.

++
Reply


Messages In This Thread
Use bool variables: It's easy. - by Baltimore - 11.07.2014, 16:31
Re : Use bool variables: It's easy. - by S4t3K - 11.07.2014, 16:41
Re: Use bool variables: It's easy. - by Baltimore - 11.07.2014, 16:46
Re: Use bool variables: It's easy. - by sammp - 11.07.2014, 20:32
Re : Use bool variables: It's easy. - by S4t3K - 12.07.2014, 19:17
Re: Use bool variables: It's easy. - by Vince - 12.07.2014, 19:30
Re : Use bool variables: It's easy. - by S4t3K - 12.07.2014, 19:52
Re: Use bool variables: It's easy. - by Vince - 12.07.2014, 20:07
Re: Use bool variables: It's easy. - by PT - 13.07.2014, 00:26
Re: Use bool variables: It's easy. - by Juvanii - 13.07.2014, 06:06

Forum Jump:


Users browsing this thread: 2 Guest(s)