05.12.2010, 14:13
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;
}