SA-MP Forums Archive
[HELP]Checkpoint! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Checkpoint! (/showthread.php?tid=196350)

Pages: 1 2


Re: [HELP]Checkpoint! - fangoth1 - 05.12.2010

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;
}



Re: [HELP]Checkpoint! - [Aka]Dragonu - 05.12.2010

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 .


Re: [HELP]Checkpoint! - fangoth1 - 05.12.2010

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));



Re: [HELP]Checkpoint! - [Aka]Dragonu - 05.12.2010

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


Re: [HELP]Checkpoint! - fangoth1 - 05.12.2010

like where that players data stores


Re: [HELP]Checkpoint! - [Aka]Dragonu - 05.12.2010

Testing tomorrow , now I am going to bed !