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 ?