Give weapon command not works
#8

First why do you want if(wep == 35 && 36 && 38 ) you need if(wep == 35 || 36 || 38 ).

&& - Means "and" so if(wep == 35 and 36 and 38 ) <-- This will not work because you can only input 1 integer for wep.

|| - Means "or" so if(wep == 35 or 36 or 38 ) <-- This should work because it is asking if 35 or 36 or 38 is inputed then return.


pawn Код:
dcmd_giveweapon(playerid, params[])
{
    new pID, weap, ammo;
    if(PlayerInfo[playerid][pAdminLevel] >= 1)
    {
        if(sscanf(params, "ud", pID, weap,ammo)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /giveweapon [playerid] [weaponid] [amount of ammo]");
        if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "This player is not connected");
        if(weap == 35 || 36 || 38)return SendClientMessage(playerid, COLOR_RED, "This weapon is disabled in our server");
        if(IsValidWeapon(weap)) return SendClientMessage(playerid,red,"ERROR: Invalid weapon ID");
        GivePlayerWeapon(pID,weap,ammo);
    }
    else return SendClientMessage(playerid, COLOR_RED, "You are not admin.");
    return 1;
}
Reply


Messages In This Thread
Give weapon command not works - by aqu - 14.03.2011, 13:44
Re: Give weapon command not works - by XFlawless - 14.03.2011, 13:45
Re: Give weapon command not works - by Pz - 14.03.2011, 13:46
Re: Give weapon command not works - by HyperZ - 14.03.2011, 13:48
Re: Give weapon command not works - by aqu - 14.03.2011, 13:59
Re: Give weapon command not works - by ricardo178 - 14.03.2011, 14:02
Re: Give weapon command not works - by XFlawless - 14.03.2011, 14:04
Re: Give weapon command not works - by Tee - 14.03.2011, 14:44
Re: Give weapon command not works - by [WF]Demon - 14.03.2011, 15:01

Forum Jump:


Users browsing this thread: 4 Guest(s)