How to make a command with an extra parameter?
#3

Use it like this:

pawn Код:
if(strcmp(cmd,"/handsup",true) == 0)
{
  new tmp[128];
  tmp = strtok(cmdtext,idx);
  if(!strcmp("1",tmp,true))
  {
    ApplyAnimation(playerid,"ROB_BANK","SHP_HandsUp_Scr",4.1,1,1,1,1,0);
  }
  if(!strcmp("2",tmp,true))
  {
    ApplyAnimation(playerid,"PED","handsup",4.1,1,1,1,1,0);
  }
  else SendClientMessage(playerid,0xFFFFFFFF,"USAGE: /handsup [1-2]");
  return 1;
}
Unsure if it works, but my /style command is based on it.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)