Limit of usage
#1

How could I make so the limit it is like 3 times/usage?..

I mean with this, I don't remember what it's named but, I'll show:

pawn Код:
if (strcmp("/barrier", cmdtext, true, 10) == 0)
    {
        {
            if(BarrierUse[playerid] == 0)
            {
            BarrierUse[playerid]=8;
            GetPlayerPos(playerid, X, Y, Z);
            CreateObject(935, X, Y, Z, 0.0000, 0.0000, -253.5601); //drum, cable roll: 933
            }
            //else
        //  {
        //      SendClientMessage(playerid, Red, "You have alredy used 8 barriers!");
        //  }
        }
        return 1;
    }
   
    return 0;
}
I have tired under there and it didn't work so I just commented it..

It's hard to explain!, but I hope you get it, thansk a lot.

Edit: And I have also tierd to change to 8 here:

if(BarrierUse[playerid] == 0)

But it didn't neither work..
Reply
#2

On connect, set BarrierUse[playerid] to 0. In the command:
pawn Код:
if (BarrierUse[playerid] <= 8)
{
    ++BarrierUse[playerid];
    GetPlayerPos(playerid, X, Y, Z);
    CreateObject(935, X, Y, Z, 0.0000, 0.0000, -253.5601)
}
else SendClientMessage(playerid, Red, "You have alredy used 8 barriers!");
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
On connect, set BarrierUse[playerid] to 0. In the command:
pawn Код:
if (BarrierUse[playerid] <= 8)
{
    ++BarrierUse[playerid];
    GetPlayerPos(playerid, X, Y, Z);
    CreateObject(935, X, Y, Z, 0.0000, 0.0000, -253.5601)
}
else SendClientMessage(playerid, Red, "You have alredy used 8 barriers!");
Thanks a lot! .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)