help converting STRCMP to ZCMD
#1

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/rules") && Showing[playerid] == 0)
    {
        if(Showing[playerid] == 1)
        {
            Showing[playerid] = 0;
            TextDrawHideForPlayer(playerid, Rules0);
            TextDrawHideForPlayer(playerid, Rules1);
            TextDrawHideForPlayer(playerid, Rules2);
            TextDrawHideForPlayer(playerid, Rules3);
            TextDrawHideForPlayer(playerid, Rules4);
            TextDrawHideForPlayer(playerid, Rules5);
            TextDrawHideForPlayer(playerid, Rules6);
            TextDrawHideForPlayer(playerid, Rules7);
            TextDrawHideForPlayer(playerid, Rules9);
            TextDrawHideForPlayer(playerid, RulesGod);
            TextDrawHideForPlayer(playerid, Rules10);
            TextDrawHideForPlayer(playerid, Rules11);
            TextDrawHideForPlayer(playerid, Rules12);
            TextDrawHideForPlayer(playerid, Rules13);
            TextDrawHideForPlayer(playerid, Rules14);
            TextDrawHideForPlayer(playerid, Rules15);
        }
        else
        {
            Showing[playerid] = 1;
            TextDrawShowForPlayer(playerid, Rules0);
            TextDrawShowForPlayer(playerid, Rules1);
            TextDrawShowForPlayer(playerid, Rules2);
            TextDrawShowForPlayer(playerid, Rules3);
            TextDrawShowForPlayer(playerid, Rules4);
            TextDrawShowForPlayer(playerid, Rules5);
            TextDrawShowForPlayer(playerid, Rules6);
            TextDrawShowForPlayer(playerid, Rules7);
            TextDrawShowForPlayer(playerid, Rules9);
            TextDrawShowForPlayer(playerid, RulesGod);
            TextDrawShowForPlayer(playerid, Rules10);
            TextDrawShowForPlayer(playerid, Rules11);
            TextDrawShowForPlayer(playerid, Rules12);
            TextDrawShowForPlayer(playerid, Rules13);
            TextDrawShowForPlayer(playerid, Rules14);
            TextDrawShowForPlayer(playerid, Rules15);
            SetTimerEx("HideTextdraws", 20000, 0, "i", playerid);
        }
    }
    return 1;
}
how i can transport this to ZCMD
Reply
#2

pawn Код:
CMD:rules(playerid, params[])
{
        if(Showing[playerid] == 1)
        {
            Showing[playerid] = 0;
            TextDrawHideForPlayer(playerid, Rules0);
            TextDrawHideForPlayer(playerid, Rules1);
            TextDrawHideForPlayer(playerid, Rules2);
            TextDrawHideForPlayer(playerid, Rules3);
            TextDrawHideForPlayer(playerid, Rules4);
            TextDrawHideForPlayer(playerid, Rules5);
            TextDrawHideForPlayer(playerid, Rules6);
            TextDrawHideForPlayer(playerid, Rules7);
            TextDrawHideForPlayer(playerid, Rules9);
            TextDrawHideForPlayer(playerid, RulesGod);
            TextDrawHideForPlayer(playerid, Rules10);
            TextDrawHideForPlayer(playerid, Rules11);
            TextDrawHideForPlayer(playerid, Rules12);
            TextDrawHideForPlayer(playerid, Rules13);
            TextDrawHideForPlayer(playerid, Rules14);
            TextDrawHideForPlayer(playerid, Rules15);
        }
        else
        {
            Showing[playerid] = 1;
            TextDrawShowForPlayer(playerid, Rules0);
            TextDrawShowForPlayer(playerid, Rules1);
            TextDrawShowForPlayer(playerid, Rules2);
            TextDrawShowForPlayer(playerid, Rules3);
            TextDrawShowForPlayer(playerid, Rules4);
            TextDrawShowForPlayer(playerid, Rules5);
            TextDrawShowForPlayer(playerid, Rules6);
            TextDrawShowForPlayer(playerid, Rules7);
            TextDrawShowForPlayer(playerid, Rules9);
            TextDrawShowForPlayer(playerid, RulesGod);
            TextDrawShowForPlayer(playerid, Rules10);
            TextDrawShowForPlayer(playerid, Rules11);
            TextDrawShowForPlayer(playerid, Rules12);
            TextDrawShowForPlayer(playerid, Rules13);
            TextDrawShowForPlayer(playerid, Rules14);
            TextDrawShowForPlayer(playerid, Rules15);
            SetTimerEx("HideTextdraws", 20000, 0, "i", playerid);
        }
    }
    return 1;
}
Reply
#3

pawn Код:
COMMAND:rules(playerid, params[]) // or CMD:rules(playerid, params[])
{
        if(Showing[playerid] == 1)
        {
            Showing[playerid] = 0;
            TextDrawHideForPlayer(playerid, Rules0);
            TextDrawHideForPlayer(playerid, Rules1);
            TextDrawHideForPlayer(playerid, Rules2);
            TextDrawHideForPlayer(playerid, Rules3);
            TextDrawHideForPlayer(playerid, Rules4);
            TextDrawHideForPlayer(playerid, Rules5);
            TextDrawHideForPlayer(playerid, Rules6);
            TextDrawHideForPlayer(playerid, Rules7);
            TextDrawHideForPlayer(playerid, Rules9);
            TextDrawHideForPlayer(playerid, RulesGod);
            TextDrawHideForPlayer(playerid, Rules10);
            TextDrawHideForPlayer(playerid, Rules11);
            TextDrawHideForPlayer(playerid, Rules12);
            TextDrawHideForPlayer(playerid, Rules13);
            TextDrawHideForPlayer(playerid, Rules14);
            TextDrawHideForPlayer(playerid, Rules15);
        }
        else
        {
            Showing[playerid] = 1;
            TextDrawShowForPlayer(playerid, Rules0);
            TextDrawShowForPlayer(playerid, Rules1);
            TextDrawShowForPlayer(playerid, Rules2);
            TextDrawShowForPlayer(playerid, Rules3);
            TextDrawShowForPlayer(playerid, Rules4);
            TextDrawShowForPlayer(playerid, Rules5);
            TextDrawShowForPlayer(playerid, Rules6);
            TextDrawShowForPlayer(playerid, Rules7);
            TextDrawShowForPlayer(playerid, Rules9);
            TextDrawShowForPlayer(playerid, RulesGod);
            TextDrawShowForPlayer(playerid, Rules10);
            TextDrawShowForPlayer(playerid, Rules11);
            TextDrawShowForPlayer(playerid, Rules12);
            TextDrawShowForPlayer(playerid, Rules13);
            TextDrawShowForPlayer(playerid, Rules14);
            TextDrawShowForPlayer(playerid, Rules15);
            SetTimerEx("HideTextdraws", 20000, 0, "i", playerid);
        }
    return 1;
}
try this.
Reply
#4

https://sampforum.blast.hk/showthread.php?tid=91354

Take a look at that.

https://sampforum.blast.hk/showthread.php?tid=280282

https://www.******.no/search?q=conve...=210&es_sm=122
Reply
#5

Quote:
Originally Posted by Abagail
Посмотреть сообщение
pawn Код:
CMD:rules(playerid, params[])
{
        if(Showing[playerid] == 1)
        {
            Showing[playerid] = 0;
            TextDrawHideForPlayer(playerid, Rules0);
            TextDrawHideForPlayer(playerid, Rules1);
            TextDrawHideForPlayer(playerid, Rules2);
            TextDrawHideForPlayer(playerid, Rules3);
            TextDrawHideForPlayer(playerid, Rules4);
            TextDrawHideForPlayer(playerid, Rules5);
            TextDrawHideForPlayer(playerid, Rules6);
            TextDrawHideForPlayer(playerid, Rules7);
            TextDrawHideForPlayer(playerid, Rules9);
            TextDrawHideForPlayer(playerid, RulesGod);
            TextDrawHideForPlayer(playerid, Rules10);
            TextDrawHideForPlayer(playerid, Rules11);
            TextDrawHideForPlayer(playerid, Rules12);
            TextDrawHideForPlayer(playerid, Rules13);
            TextDrawHideForPlayer(playerid, Rules14);
            TextDrawHideForPlayer(playerid, Rules15);
        }
        else
        {
            Showing[playerid] = 1;
            TextDrawShowForPlayer(playerid, Rules0);
            TextDrawShowForPlayer(playerid, Rules1);
            TextDrawShowForPlayer(playerid, Rules2);
            TextDrawShowForPlayer(playerid, Rules3);
            TextDrawShowForPlayer(playerid, Rules4);
            TextDrawShowForPlayer(playerid, Rules5);
            TextDrawShowForPlayer(playerid, Rules6);
            TextDrawShowForPlayer(playerid, Rules7);
            TextDrawShowForPlayer(playerid, Rules9);
            TextDrawShowForPlayer(playerid, RulesGod);
            TextDrawShowForPlayer(playerid, Rules10);
            TextDrawShowForPlayer(playerid, Rules11);
            TextDrawShowForPlayer(playerid, Rules12);
            TextDrawShowForPlayer(playerid, Rules13);
            TextDrawShowForPlayer(playerid, Rules14);
            TextDrawShowForPlayer(playerid, Rules15);
            SetTimerEx("HideTextdraws", 20000, 0, "i", playerid);
        }
    }
    return 1;
}
U have added a unmatched "}". Below is the right codes!
pawn Код:
CMD:rules(playerid, params[])
{
        if(Showing[playerid] == 1)
        {
            Showing[playerid] = 0;
            TextDrawHideForPlayer(playerid, Rules0);
            TextDrawHideForPlayer(playerid, Rules1);
            TextDrawHideForPlayer(playerid, Rules2);
            TextDrawHideForPlayer(playerid, Rules3);
            TextDrawHideForPlayer(playerid, Rules4);
            TextDrawHideForPlayer(playerid, Rules5);
            TextDrawHideForPlayer(playerid, Rules6);
            TextDrawHideForPlayer(playerid, Rules7);
            TextDrawHideForPlayer(playerid, Rules9);
            TextDrawHideForPlayer(playerid, RulesGod);
            TextDrawHideForPlayer(playerid, Rules10);
            TextDrawHideForPlayer(playerid, Rules11);
            TextDrawHideForPlayer(playerid, Rules12);
            TextDrawHideForPlayer(playerid, Rules13);
            TextDrawHideForPlayer(playerid, Rules14);
            TextDrawHideForPlayer(playerid, Rules15);
        }
        else
        {
            Showing[playerid] = 1;
            TextDrawShowForPlayer(playerid, Rules0);
            TextDrawShowForPlayer(playerid, Rules1);
            TextDrawShowForPlayer(playerid, Rules2);
            TextDrawShowForPlayer(playerid, Rules3);
            TextDrawShowForPlayer(playerid, Rules4);
            TextDrawShowForPlayer(playerid, Rules5);
            TextDrawShowForPlayer(playerid, Rules6);
            TextDrawShowForPlayer(playerid, Rules7);
            TextDrawShowForPlayer(playerid, Rules9);
            TextDrawShowForPlayer(playerid, RulesGod);
            TextDrawShowForPlayer(playerid, Rules10);
            TextDrawShowForPlayer(playerid, Rules11);
            TextDrawShowForPlayer(playerid, Rules12);
            TextDrawShowForPlayer(playerid, Rules13);
            TextDrawShowForPlayer(playerid, Rules14);
            TextDrawShowForPlayer(playerid, Rules15);
            SetTimerEx("HideTextdraws", 20000, 0, "i", playerid);
        }
 
        return 1;
}
EDIT: too late
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)