Comparing a string to a string in an array?
#5

I did this and it did not work.

pawn Code:
CMD:weptest(playerid, params[])
{
    new string[50];
    if(sscanf(params, "s[50]", string)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /weptest [weapon]");
    for(new w = 0; w < 12; w++)
    {
        new model = WepModel[PlayerWeapons[w][playerid]];
        if(!strcmp(WeaponNames[model], string, true))
        {
            format(string, sizeof(string), "Weapon: %s | Ammo: %d | Weapon ID: %d", WeaponNames[model], WepAmmo[w], w);
            SendClientMessage(playerid, COLOUR_WHITE, string);
        }
    }

    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)