Use command
#1

pawn Код:
CMD:use(playerid, params[])
{
    if(strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Usage: /use [Item]");
    else
    {
        if(strcmp(params,"medikit",true) == 0)
        {
          if(PlayerInfo[playerid][Medikit] == 0) SendClientMessage(playerid, COLOR_RED, "You dont have a medikit, Buy one from a local shop");
          else
          {
                if(PlayerInfo[playerid][Medikit] == 1)
                {
                  new string[300];
                  PlayerInfo[playerid][Medikit] = 0;
                  format(string, sizeof(string), "Medikit set to %d", PlayerInfo[playerid][Medikit]);
                  SendClientMessage(playerid, COLOR_ORANGE, string);
                }
                else if(PlayerInfo[playerid][Medikit] == 2)
                {
                  new string[300];
                  PlayerInfo[playerid][Medikit] = 1;
                  format(string, sizeof(string), "Medikit set to %d", PlayerInfo[playerid][Medikit]);
                  SendClientMessage(playerid, COLOR_ORANGE, string);
            }
            }
        }
    }
    return 1;
}
Thats my code.. And
pawn Код:
if(strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Usage: /use [Item]");
That shows up as it should if i type /use, But if i type /use medikit, It says usage again but it shouldnt,
If i make it
pawn Код:
if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Usage: /use [Item]");
And type /use, No message appears, But if i type /use medikit, It works as it should,
Ive tried removing the return on the code but makes no difference,
Anyone know why?
Reply


Messages In This Thread
Use command - by Torran - 25.02.2010, 20:12
Re: Use command - by Keeboo13 - 26.02.2010, 07:58
Re: Use command - by Torran - 26.02.2010, 11:37
Re: Use command - by bajskorv123 - 26.02.2010, 13:33
Re: Use command - by Torran - 26.02.2010, 13:44
Re: Use command - by notime - 26.02.2010, 23:04

Forum Jump:


Users browsing this thread: 2 Guest(s)