15.09.2011, 23:13
Optional values
pawn Код:
CMD:v(playerid, params[])
{
new amount, string[128], objectives[12], targetid;
if(sscanf(params, "s[12]D(-1)U(-1)", objectives, amount, targetid)) SendClientMessage(playerid, COLOR_RED, "{F42626}[Usage] {FFFFFF}/v [sell/buy/find]");
else if(!strcmp(objectives, "sell", true))
{
if(amount > ...) SendClientMessage(playerid, COLOR_RED, "amount must be higher than ...");
else if(!IsPlayerConnected(targetid)) SendClientMessage(playerid, COLOR_RED, "id is offline");
else{
// set amount and targetid
}
}
else if(!strcmp(objectives, "buy", true))
{
}
else if(!strcmp(objectives, "find", true))
{
if(amount == (-1) || targetid == (-1)) SendClientMessage(playerid, COLOR_RED, "'Use: /v find [id]'");
}
else SendClientMessage(playerid, COLOR_RED, "{F42626}[Usage] {FFFFFF}/v [sell/buy/find]");
return 1;
}