/giveweapon command filterscript error.
#1

script:
pawn Код:
new id;
    new weap;
    new ammo;
    if(IsPlayerConnected(id))
        {
        if(PlayerInfo[playerid] [AdminLevel] >= 106)
            {
            if(!sscanf(params, "uii", id, weap, ammo))
                {
                if(weap >= 1 && weap <= 46)
                                {
                                    if(ammo >= 1 && ammo <= 5000)
                                    {


                        new string[64];
                        new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, name, sizeof(name));
                        GetPlayerName(id, PlayerName, sizeof(PlayerName));
                        format(string, sizeof(string), "%s has given You weapon %d with %d ammu.", name, weap, ammo);
                        SendClientMessage(id, 0xFF00CC, string);
                        format(string, sizeof(string), "You gave weapon %d with %d ammu to %s .", weap, ammo, PlayerName);
                        SendClientMessage(playerid, 0xFF00CC, string);
                        GivePlayerWeapon(id, weap, ammo);
                        return 1;
                    }
                    else return SendClientMessage(playerid, 0xFF00CC, "Max. Ammo is 5000");
                }
                else return SendClientMessage(playerid, 0xFF00CC, "Invalid weapon id!");
    else {
            SendClientMessage(playerid, 0xFF00CC, "USAGE: /giveweapon[PlayerId/PartOfName] [WeaponId] [Ammo]"),
            SendClientMessage(playerid, 0xFF00CC, "1(Brass) 2(Nite) 3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 9(Chainsaw) 10-13(Dildo)"),
            SendClientMessage(playerid, 0xFF00CC, "14(Flowers) 15(Cane) 16(Grenades) 17(Teargas) 18(Molotovs) 22(Pistol) 23(SPistol) 24(Eagle)"),
            SendClientMessage(playerid, 0xFF00CC, "25(Shotgun) 26(sawn-off) 27(Combat) 28(TEC9) 29(MP5) 30(AK47) 31(M4) 32(MAC10) 33(Country)"),
            return SendClientMessage(playerid, 0xFF00CC, "34(Sniper) 35(RPG) 37(Flamethrower) 38(Minigun) 41(spray) 42(exting) 43(Camera) 46(Parachute)");
            }
    else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");    }    else return SendClientMessage(playerid, 0xFF00CC, "Player Is Not Connected");}
errors:
Quote:

C:\Users\Owner\Desktop\Raven's Roleplay 0.3c\filterscripts\Giveweapon.pwn(3) : warning 203: symbol is never used: "giveweapon"
C:\Users\Owner\Desktop\Raven's Roleplay 0.3c\filterscripts\Giveweapon.pwn(3 -- 40) : error 013: no entry point (no public functions)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Please Help Me !
Reply
#2

Please use [ pawn] < At the beginning, and [/pawn ] < At the end, it makes it easier to read.

Obviously without the spaces.
Reply
#3

ok thanks
Reply
#4

You didn't include a_samp nor sscanf.

You didn't add public OnPlayerCommandText( playerid, cmdtext[ ] ), you didn't add a command! Practically, you didn't add anything...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)