[HELP]Checkpoint!
#21

here you will have to define a little bit on your own
pawn Код:
new cmd[128], tmp[128], string[128], idx;
    cmd = strtok(cmdtext, idx);

    if (strcmp("/depositdrugs", cmdtext, true, 6) == 0)

        if (PlayerToPoint(8, playerid,-78.2537,-1135.9974,1.0781,))
       
        new drugs = strval(tmp);
        // you will have to define if they have any drugs here with a -
       
        SendClientMessage(playerid, COLOR_WHITE, "/Depositdrugs[ammount]");

        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))

        new ammount = strval(tmp);
        if( ammount >= 1 && ammount <= 9999999)
        if( ammount >= 0)return SendClientMessage(playerid, COLOR_RED, "invalid Ammount");
        }
        else
        {
        Pinfo// whatever data you got , where its store you will have to put here
       
        format(string, sizeof(string), "You Have Deposited %s Drugs", ammount);
        SendClientMessage(playerid, COLOR_GOLD, string);
        format(string, sizeof(string), "You Now have Totoal Of %s Drugs after you stored %s", Pinfo, ammount);// you must define it here aswell
        SendClientMessage(playerid, COLOR_ROYALBLUE, string);
        }
        }
        else
        {
        SendClientMessage(playerid, COLOR_RED, "SERVER: You need to be in a drug checkpoint to use this command");
        }
        return 1;

    if (strcmp("/withdrawdrugs", cmdtext, true, 6) == 0)
    {
        if (PlayerToPoint(8, playerid,-78.2537,-1135.9974,1.0781,))
       
        new drugs = strval(tmp);
        // you will have to define if they have any drugs here with a +
        SendClientMessage(playerid, COLOR_WHITE, "/withdrawdrugs[ammount]");

        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))

        new ammount = strval(tmp);
        if( ammount >= 1 && ammount <= 9999999)
        if( ammount >= 0)return SendClientMessage(playerid, COLOR_RED, "invalid Ammount");
        }
        else
        {
        Pinfo// whatever data you got , where its store you will have to put here

        format(string, sizeof(string), "You Have Withdrew %s Drugs", ammount);
        SendClientMessage(playerid, COLOR_GOLD, string);
        format(string, sizeof(string), "You Now have Totoal Of %s Drugs after you took %s", Pinfo, ammount);// you must define it here aswell
        SendClientMessage(playerid, COLOR_ROYALBLUE, string);
        }
        }
        else
        {
        SendClientMessage(playerid, COLOR_RED, "SERVER: You need to be in a drug checkpoint to use this command");
        }
        return 1;
        }
    return 0;
}
Reply
#22

I will test it later . Thank you ! '

How to define // you will have to define if they have any drugs here with a + ?

Give me an example please .
Reply
#23

like + = Add the drugs to the Pinfo
and - = subtract the drugs to he pinfo
something like that you just have to define it how you want
pawn Код:
(drugs(playerid) == -amount));
Reply
#24

and this ? // whatever data you got , where its store you will have to put here
Reply
#25

like where that players data stores
Reply
#26

Testing tomorrow , now I am going to bed !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)