Jump to content

Stringhash


mandat

Recommended Posts

Salut, am o problema.

 

YCMD:set(playerid, params[], help) 
{
    if(playerData[playerid][playerAdmin] < 3) 
        return SCM(playerid, COLOR_LIGHTGREEN3, "You are not allowed to use this command."); 

    new 
        user,
        option[32],
        value;

    if(sscanf(params, "us[32]d", user, option, value))
    { 
        SCM(playerid, COLOR_GREY, "Usage: {ffffff}/set <name/playerid> <option> <value>");
        SCM(playerid, COLOR_WHITE, "Options: heal, armour");
        return 1;
    }

    switch(YHash(option, false))
    {
        case _H<health>:
        {
            SetPlayerHealth(user, value);

        }
        case _H<armour>:
        {
            SetPlayerArmour(user, value);
        }
    }

    return 1;
}
 

=> comanda nu rezulta nimic, am facut test cu strcmp imi seteaza heal si armour, dar cu YHash nu rezulta nimic.. am schimbate de multe ori multe include YHash nimic, nu stiu ce e gresit, am mai lucrat cu acest include si a functionat perfect, acum ce l-a apucat?

Link to comment
Share on other sites

Problema este faptul ca ii spui sa ignore daca string este scris cu litere mari sau mici dar folosesti declaratia normala _H in loc de _I

https://github.com/pawn-lang/YSI-Includes/blob/5.x/YSI_Coding/y_stringhash/features.md

switch(YHash(option, false))
    {
        case _I<health>:
        {
            SetPlayerHealth(user, value);

        }
        case _I<armour>:
        {
            SetPlayerArmour(user, value);
        }

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.