29.07.2012, 09:50
I prefer using sscanf.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(drift,5,cmdtext);
return 0;
}
dcmd_drift(playerid,params[])
{
new id;
if(sscanf(params,"i",id)) return SendClientMessage(playerid,-1,"Usage : /drift [id]");
switch (id)
{
case 1 : //Equivalent to /drift1
case 2 : ///drift2 and so on
}
return 1;
}