GiveAllweapon
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
I suppose this function accepts a string, but you've declared it as in integer:

GetWeaponIDFromName(Weap)
pawn Код:
CMD:giveallweapon(playerid,params[])
{
    if(PInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid)) {
        new Weap,WeapID[20], ammo, name[MAX_PLAYER_NAME], string[128];
        if(sscanf(params,"si",Weap, ammo)) return SendClientMessage(playerid,RED,"Usage: /giveallweapon [weapon name] [ammo]");
        if(!IsValidWeapon(Weap)) return SendClientMessage(playerid,RED,"ERROR: Invalid weapon ID");
        ACMDM(playerid,"GIVEALLWEAPON");
        GetWeaponIDFromName(Weap,WeapID,20); //3024
        foreach(Player, i)
        {
            PlayerPlaySound(i,1057,0.0,0.0,0.0);
            GivePlayerWeapon(i,WeapID,ammo); //3028
        }
        GetPlayerName(playerid,name,sizeof(name));
        format(string,sizeof(string),"Administrator %s has given all players weapon: %s with %d ammo",name,Weap,ammo);
        SendClientMessageToAll(blue,string);
    }
    else return SendClientMessage(playerid,RED,"You are not a high enough level to use this command");
    return 1;
}
Changed it a bit and now I get

pawn Код:
C:\Users\Chris\Documents\Serv\Server\gamemodes\COS.pwn(3024) : error 035: argument type mismatch (argument 1)
C:\Users\Chris\Documents\Serv\Server\gamemodes\COS.pwn(3028) : error 035: argument type mismatch (argument 2)
Reply


Messages In This Thread
GiveAllweapon - by Snipa - 21.03.2011, 13:00
Re: GiveAllweapon - by Vince - 21.03.2011, 13:07
Re: GiveAllweapon - by Snipa - 21.03.2011, 23:06
Re: GiveAllweapon - by Jefff - 22.03.2011, 00:57
Re: GiveAllweapon - by Snipa - 22.03.2011, 01:25
Re: GiveAllweapon - by Jefff - 22.03.2011, 01:26
Re: GiveAllweapon - by Snipa - 22.03.2011, 01:38

Forum Jump:


Users browsing this thread: 1 Guest(s)