22.07.2012, 19:20
hmm.....
1.: YCMD : https://sampforum.blast.hk/showthread.php?tid=169029 + tutorial
example command
sscanf Link: https://sampforum.blast.hk/showthread.php?tid=120356
learn it and you will know how to make easily a command for example in sscanf
How you can see u = Player ID/Name and ammount ( d) is an integrer ) = number ( ex: 42)
more easily than new tmp[256]; etc... sscanf >(faster than) strtok
1.: YCMD : https://sampforum.blast.hk/showthread.php?tid=169029 + tutorial
example command
pawn Код:
YCMD:me(playerid, params[], help)
{
if (help)
{
SendClientMessage(playerid, 0xFF0000AA, "Sends an action to other players.");
}
else
{
new
str[128];
if (isnull(params))
{
format(str, sizeof (str), "Usage: \"/%s [action]\"", Command_GetDisplayNamed("me", playerid));
SendClientMessage(playerid, 0xFF0000AA, str);
}
else
{
GetPlayerName(playerid, str, sizeof (str));
format(str, sizeof (str), "* %s %s", str, params);
SendClientMessageToAll(0xFF0000AA, str);
}
}
return 1;
}
learn it and you will know how to make easily a command for example in sscanf
pawn Код:
if(sscanf(params,"ud",id,ammount) ) return SendClientMessage(playerid,COLOR_RED,"Use /givegun [id] [ammount]");
more easily than new tmp[256]; etc... sscanf >(faster than) strtok