Problem with command
#1

Hi, guys!
I have a problem. I dont know how to fix it. Here is the code:

pawn Код:
if(!strcmp(cmdtext, "/thing", true,6))
   {
       if(playerDB[playerid][specialybe]!=4){SendClientMessage(playerid,COLOR," Its not for you."); return 1;}
                if(cmdtext[6]==0){SendClientMessage(playerid, BLUE, "* Thing for player: /thing [player name]"); return 1;}
            new vardas[MAX_PLAYER_NAME];
            strmid(vardas,cmdtext[7],0,MAX_PLAYER_NAME);
            new id = GetPlayeridMid(vardas);
            if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, RED, "* Invalid player"); return 1;}
            if (id == playerid){ SendClientMessage(playerid, RED, "* What?!"); return 1;}
      new Float:Coo[3];
      GetPlayerPos(id,Coo[0],Coo[1],Coo[2]);
      if(!PlayerToPoint(5, playerid, Coo[0],Coo[1],Coo[2])){SendClientMessage(playerid, RED, "* The player is to far"); return 1;}

        if(playerDB[id][vmegzas])
       {
          SendClientMessage(playerid,COLOR,"* The player have the thing.");
          return 1;
      }

       if(GetPlayerMoneyA(playerid)<1000)
       {
          SendClientMessage(playerid,COLOR," it cost1000LT.");
          return 1;
      }

      GivePlayerMoneyA(playerid,-1000);
        SendClientMessage(playerid,COLOR,"* Player has now test.");
        new msg[512];
    format(msg,sizeof(msg),"want it? Price1000LT.",id);
    ShowPlayerDialog(playerid,8088,DIALOG_STYLE_MSGBOX,"Thing:",msg,"Yes","No");
      return 1;
    }
And when I type /thing it says "what?" Well, itr should says: "Thing for player: /thing [player name]" But it isnt. So could you help me? I hope you understand me. Thanks for any advice
Reply
#2

Ok, but when I delete it and when I type /thing (part of a player name) it says invalid id. Whats wrong?
Reply
#3

Aš rašau vardą, o kaip tada padaryti, kad galėčiau rašyti vardą, o ne id? Pvz/ thing (vardo dalis),o ne /thing (ID)?
Reply
#4

Anyone help me?
Reply
#5

As said above
Use sscanf!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)