What's wrong with this?
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   
    //if (strcmp("/weapon", cmdtext, true, 5) == 0)
    //if (strcmp("/weapon", cmdtext, true, 7) == 0) // 7 lenght, not 5. Lenght is option so this is easier and simplier
    if (!strcmp("/weapon", cmdtext, true)) // 7 lenght, not 5. Lenght is option so this is easier
    {
        GivePlayerWeapon (playerid, 26, 500);
        return 1;
    }
   
    //if (strcmp("/armor", true) == 0)
    if (!strcmp("/armor", cmdtext, true)) // comparing string1 with true, missing string2
    {
        SetPlayerArmour(playerid, 100.0);
        SendClientMessage(playerid, 0xFFFFFF, "You now have 100 armor.");
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
What's wrong with this? - by Zach7 - 06.08.2013, 22:19
Re: What's wrong with this? - by Konstantinos - 06.08.2013, 22:22
Re: What's wrong with this? - by Zach7 - 06.08.2013, 22:24
Re: What's wrong with this? - by Konstantinos - 06.08.2013, 22:28
Re: What's wrong with this? - by Zach7 - 06.08.2013, 22:31
Re: What's wrong with this? - by Konstantinos - 06.08.2013, 22:34
Re: What's wrong with this? - by Zach7 - 06.08.2013, 22:36
Re: What's wrong with this? - by Konstantinos - 06.08.2013, 22:41
Re: What's wrong with this? - by hossa - 06.08.2013, 22:47
Re: What's wrong with this? - by Zach7 - 06.08.2013, 23:47

Forum Jump:


Users browsing this thread: 1 Guest(s)