Posts: 2,593
Threads: 34
Joined: Dec 2007
pawn Код:
CMD:v(playerid, params[])
{
new amount, string[128], objectives[12], targetid;
if(sscanf(params, "s[12]du", 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))
{
}
else SendClientMessage(playerid, COLOR_RED, "{F42626}[Usage] {FFFFFF}/v [sell/buy/find]");
return 1;
}
Posts: 94
Threads: 16
Joined: Oct 2008
Reputation:
0
Ok, i got the commands working now. When i type /v ig it shows use: /v [sell/buy/find].
But when i do /v find it dosent show any text. How to make when i do '/v find' let the game send you msg 'Use: /v find [id]' ?
Also when i do /v find carid ig, it shows 'use: /v [sell/buy/find]', i just want it to show when player type: /v
Posts: 2,593
Threads: 34
Joined: Dec 2007
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;
}
Posts: 94
Threads: 16
Joined: Oct 2008
Reputation:
0
15.09.2011, 23:21
(
Последний раз редактировалось JaTochNietDan; 16.09.2011 в 01:31.
Причина: Stop double posting, use the edit button.
)
Just what i needed! Thanks alot for your help Jefff!
if(amount == (-1) || targetid == (-1))
it didnt work on /v sell tho, what do i need to put there?