/giveallweapon doesnt work
#3

pawn Код:
dcmd_giveallweapon(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 3)
    {
        new tmp[256], tmp2[256], Index;
        new ammo, weap, WeapName[32];
        new string[128];
        tmp = strtok(params,Index); tmp2 = strtok(params,Index);
        if(!strlen(tmp)) return
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /giveallweapon [WeaponID or WeaponName] [Ammo]") &&
        SendClientMessage(playerid, orange, "Function: Will give a specified weapon and ammo for all players");
       
        if(!strlen(tmp2) || !IsNumeric(tmp2) || strval(tmp2) <= 0 || strval(tmp2) > 99999) ammo = 500;
        if(!IsNumeric(tmp))
        weap = GetWeaponIDFromName(tmp);
        else weap = strval(tmp);
                      ammo = strval(tmp2)
        if(!IsValidWeapon(weap))
        return SendClientMessage(playerid,red,"ERROR: Invalid Weapon ID");
        SendCommandToAdmins(playerid,"GiveAllWeapon");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
            PlayerPlaySound(i,1057,0.0,0.0,0.0);
            GivePlayerWeapon(i,weap,ammo);
            }
        }
        GetWeaponName(weap, WeapName, sizeof(WeapName));
        format(string,sizeof(string),"All Players received a %s (%d) with %d rounds of Ammo", WeapName, weap, ammo);
        return SendClientMessageToAll(pmsg, string);
    }
    else return ErrorMessages(playerid, 1);
Maybe because you didn't set 'ammo' variable value?
Reply


Messages In This Thread
/giveallweapon doesnt work - by [swat]dragon - 24.04.2012, 23:08
Re: /giveallweapon doesnt work - by Face9000 - 24.04.2012, 23:14
Respuesta: /giveallweapon doesnt work - by Marricio - 24.04.2012, 23:16
Re: /giveallweapon doesnt work - by [swat]dragon - 24.04.2012, 23:21

Forum Jump:


Users browsing this thread: 1 Guest(s)