Checking Weapon ID-Name
#4

pawn Код:
CMD:giveweapon(playerid, params[])
{
    new id, weapon[26], ammo;
    if (sscanf(params, "usd", id, weapon, ammo)) SendClientMessage(playerid, 0xFF0000AA, "DEBUG: \"/giveweapon <playerid> <weaponid> <ammo>\"");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "DEBUG: \"/giveweapon <playerid> <weaponid> <ammo>\"");
    new checkweapon = CompareWeaponName(weapon);
    if(!checkweapon) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Not a valid Weapon Name");
    if(IsPlayerConnected(id))
    {
        if(checkweapon==2||checkweapon==4||checkweapon==5||checkweapon==6||checkweapon==14||checkweapon==41||checkweapon==43)
        {
            GivePlayerWeapon(id, checkweapon, 1);
            return true;
        }
        else GivePlayerWeapon(id, checkweapon, ammo);
    }
    return true;
}
Reply


Messages In This Thread
Checking Weapon ID-Name - by Ruben_Alonso - 21.04.2012, 12:27
Re: Checking Weapon ID-Name - by Roel - 21.04.2012, 12:31
Re: Checking Weapon ID-Name - by Ruben_Alonso - 21.04.2012, 12:33
Re: Checking Weapon ID-Name - by Roel - 21.04.2012, 12:35
Re: Checking Weapon ID-Name - by Ruben_Alonso - 21.04.2012, 12:36
Re: Checking Weapon ID-Name - by Roel - 21.04.2012, 12:37
Re: Checking Weapon ID-Name - by Ruben_Alonso - 21.04.2012, 12:38
Re: Checking Weapon ID-Name - by Roel - 21.04.2012, 12:39
Re: Checking Weapon ID-Name - by Ruben_Alonso - 21.04.2012, 12:41
Re: Checking Weapon ID-Name - by Roel - 21.04.2012, 12:41

Forum Jump:


Users browsing this thread: 2 Guest(s)