16.04.2012, 02:05
It's easy to add more parameters with strcmp (the old-school way :P)
But as everyone is saying, switch to ZCMD and SSCANF.
pawn Код:
if(strcmp(cmd, "/aj", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pGmL] >= 2)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "Uz.yj: /aj [ID] [MIN]");
new para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "Uz.yj: /aj [ID] [MIN]");
new level = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "Uz.yj: /aj [ID] [MIN] [PARAM 3]");
new para3 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "Uz.yj: /aj [ID] [MIN] [PARAM 4]");
new para4 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "Uz.yj: /aj [ID] [MIN] [PARAM 5]");
new para5 = strval(tmp);
//done...