dcmd_buy... Help please =)
#1

I'm back with new problem :P

pawn Код:
dcmd_buy(playerid,params[])
    {
      if(PlayerInfo[playerid][pAmmunation] == 1)
      {
        new weapon;
        if(sscanf(params,"s",weapon)) return SendClientMessage(playerid,COLOR_DARKRED,"Usage: /buy <bat/silenced>");
        if( ) // IF TYPE /BUY COMBATKNIFE... How to fix? :P
        {
          GivePlayerWeapon(playerid,4,1);
          GivePlayerMoney(playerid,-1000);
          SendClientMessage(playerid,COLOR_LIGHTBLUE,"Bought a Combat Knife");
            }
        }
        else SendClientMessage(playerid,COLOR_DARKRED,"Not in a store");
        return 1;
    }
Anyone know how to fix? :P plz :P
Reply
#2

You are doing the same mistake as your /report command..

You want to scan the command parameters for a weapon NAME, so your variable "weapon" should be an array.

And for your main rpoblem, use strcmp, like any strings comparisons..
pawn Код:
if (!strcmp(params, "combaknife"))
Reply
#3

THX
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)