sourcepawn icon indicating copy to clipboard operation
sourcepawn copied to clipboard

Warning 246: function hitGroupName returns an array but return type is not marked as an array

Open A1mDev opened this issue 1 year ago • 0 comments

Warning 246: function hitGroupName returns an array but return type is not marked as an array. Warning on old syntax, don't know if it's still supported?

public  OnPluginStart()
{
    PrintToServer("%s", hitGroupName(0));
}

stock String:hitGroupName(hitgroup)
{
    new String:tmpString[15] = "";
    switch (hitgroup)
    {
        case 0: { tmpString = "body"; }
        case 1: { tmpString = "head"; }
        case 2: { tmpString = "chest"; }
        case 3: { tmpString = "stomach"; }
        case 4: { tmpString = "left arm"; }
        case 5: { tmpString = "right arm"; }
        case 6: { tmpString = "left leg"; }
        case 7: { tmpString = "right leg"; }
        case 10: { tmpString = "???"; }
    }
    return tmpString;
}

A1mDev avatar Dec 15 '24 16:12 A1mDev