[HELP]Checkpoint!
#15

I can make that too . But can you convert me too commands ?

pawn Код:
dcmd_depositdrugs(playerid, params[])
{
    if(IsPlayerInCheckpoint(playerid))
    {
        new amount;
        if(sscanf(params, "d", amount))
        {
            return SendClientMessage(playerid, COLOR_RED, "SERVER: Usage: /depositdrugs [amount]");
        }
        else if(amount > Drugs[playerid] || amount <= 0)
        {
            return SendClientMessage(playerid, COLOR_RED, "SERVER: Invalid amount");
        }
        else
        {
            new str[64];
            Drugs[playerid] -= amount;
            PlayerInfo[playerid][pDrugs] += amount;
            format(str, 64, "*You have deposited %d grams of drugs", amount);
            SendClientMessage(playerid, COLOR_YELLOW, str);
            format(str, 64, "*You now have %d grams of drugs in your safe", PlayerInfo[playerid][pDrugs]);
            SendClientMessage(playerid, COLOR_YELLOW, str);
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "SERVER: You need to be in a drug checkpoint to use this command");
    }
    return 1;
}

dcmd_withdrawdrugs(playerid, params[])
{
    if(IsPlayerInCheckpoint(playerid))
    {
        new amount;
        if(sscanf(params, "d", amount))
        {
            return SendClientMessage(playerid, COLOR_RED, "SERVER: Usage: /withdrawdrugs [amount]");
        }
        else if(amount > PlayerInfo[playerid][pDrugs] || amount <= 0)
        {
            return SendClientMessage(playerid, COLOR_RED, "SERVER: Invalid amount");
        }
        else
        {
            new str[64];
            Drugs[playerid] += amount;
            PlayerInfo[playerid][pDrugs] -= amount;
            format(str, 64, "*You have withdrawn %d grams of drugs", amount);
            SendClientMessage(playerid, COLOR_YELLOW, str);
            format(str, 64, "*You now have %d grams of drugs in your safe", PlayerInfo[playerid][pDrugs]);
            SendClientMessage(playerid, COLOR_YELLOW, str);
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "SERVER: You need to be in a drug checkpoint to use this command");
    }
    return 1;
}
instead of player enter checkpoint i want :
pawn Код:
if (PlayerToPoint(8, playerid,-78.2537,-1135.9974,1.0781,))
and i want to make it like :
pawn Код:
if(strcmp(cmd, "/withdraw", true) == 0)
Can you do that ?
Reply


Messages In This Thread
[HELP]Checkpoint! - by [Aka]Dragonu - 05.12.2010, 11:40
Re: [HELP]Checkpoint! - by SparkZ_ - 05.12.2010, 11:42
Re: [HELP]Checkpoint! - by [Aka]Dragonu - 05.12.2010, 11:51
Re: [HELP]Checkpoint! - by SparkZ_ - 05.12.2010, 11:55
Re: [HELP]Checkpoint! - by SkizzoTrick - 05.12.2010, 11:56
Re: [HELP]Checkpoint! - by [Aka]Dragonu - 05.12.2010, 12:09
Re: [HELP]Checkpoint! - by SparkZ_ - 05.12.2010, 12:12
Re: [HELP]Checkpoint! - by [Aka]Dragonu - 05.12.2010, 12:22
Re: [HELP]Checkpoint! - by fangoth1 - 05.12.2010, 13:04
Re: [HELP]Checkpoint! - by fangoth1 - 05.12.2010, 13:26
Re: [HELP]Checkpoint! - by [Aka]Dragonu - 05.12.2010, 13:28
Re: [HELP]Checkpoint! - by fangoth1 - 05.12.2010, 13:33
Re: [HELP]Checkpoint! - by [Aka]Dragonu - 05.12.2010, 13:34
Re: [HELP]Checkpoint! - by fangoth1 - 05.12.2010, 13:37
Re: [HELP]Checkpoint! - by [Aka]Dragonu - 05.12.2010, 13:38
Re: [HELP]Checkpoint! - by fangoth1 - 05.12.2010, 13:39
Re: [HELP]Checkpoint! - by [Aka]Dragonu - 05.12.2010, 13:41
Re: [HELP]Checkpoint! - by fangoth1 - 05.12.2010, 13:44
Re: [HELP]Checkpoint! - by [Aka]Dragonu - 05.12.2010, 13:48
Re: [HELP]Checkpoint! - by fangoth1 - 05.12.2010, 13:51
Re: [HELP]Checkpoint! - by fangoth1 - 05.12.2010, 14:13
Re: [HELP]Checkpoint! - by [Aka]Dragonu - 05.12.2010, 14:43
Re: [HELP]Checkpoint! - by fangoth1 - 05.12.2010, 14:59
Re: [HELP]Checkpoint! - by [Aka]Dragonu - 05.12.2010, 15:20
Re: [HELP]Checkpoint! - by fangoth1 - 05.12.2010, 15:42
Re: [HELP]Checkpoint! - by [Aka]Dragonu - 05.12.2010, 17:51

Forum Jump:


Users browsing this thread: 1 Guest(s)