[Help]About weapons
#1

I have start my command /giveweapon on croatin /dajoruzje, and when I give weapon it look like this

| FriXion | Admin Danny_Washburn give you weapon "THIS ALL WORDS - dsajidwa1q2e".

Do you know what I mean?How to do I set when somebody gave somebody weapon is name of weapon and ID?

pawn Код:
new ImenaOruzja[][] = {
    "Brass Knuckles","Golf Club","Nightstick","Knife","Baseball Bat","Shovel","Pool Cue","Katana","Chainsaw","Double-ended Dildo","Dildo","Vibrator","Silver Vibrator","Flowers","Cane","Grenade","Tear Gas","Molotov Cocktail",
    "9mm","Silenced 9mm","Desert Eagle","Shotgun","Sawnoff Shotgun","Combat Shotgun","Micro SMG/Uzi","MP5","AK-47","M4","Tec-9","Country Rifle","Sniper Rifle","RPG","HS Rocket","Flamethrower","Minigun","Satchel Charge",
    "Detonator","Spraycan","Fire Extinguisher","Camera","Night Vis Goggles","Thermal Goggles","Parachute"
};

pawn Код:
CMD:dajoruzje(playerid, params[])
{
    new id, gun, ammo, string[128], adminime[MAX_PLAYER_NAME], igracime[MAX_PLAYER_NAME];
    if(PI[playerid][Admin] > 1 || IPA(playerid)) return SCM(playerid, BIJELA, ""COL_SVIJETLOPLAVA"| FriXion | "COL_BIJELA"Zao nam je,nemate mogucnost da koristite ovu komandu.");
    else if(sscanf(params,"uii", id, gun, ammo)) return SCM(playerid, BIJELA, ""COL_SVIJETLOPLAVA"| FriXion | "COL_BIJELA"/dajoruzje [ID/Dio imena] [ID oruzja] [Municija(metci)]");
    else if(gun > 47 || gun < 1) return SCM(playerid, BIJELA, ""COL_SVIJETLOPLAVA"| FriXion | "COL_BIJELA"Oruzje ID-ovi : "COL_SVIJETLOPLAVA"1-47");
    else if(ammo > 999 || ammo < 1) return SCM(playerid, BIJELA, ""COL_SVIJETLOPLAVA"| FriXion | "COL_BIJELA"Municija(metci) : "COL_SVIJETLOPLAVA"1-999");
    else
    {
        GetPlayerName(playerid, adminime, sizeof(adminime));
        adminime[strfind(adminime,"_")] = ' ';
        GetPlayerName(id, igracime, sizeof(igracime));
        format(string, sizeof(string), ""COL_SVIJETLOPLAVA"| FriXion | "COL_BIJELA"Dao si igracu "COL_SVIJETLOPLAVA"%s "COL_BIJELA"oruzje "COL_SVIJETLOPLAVA"%s(%d) "COL_BIJELA"sa municijom "COL_SVIJETLOPLAVA"%i", igracime, ImenaOruzja, gun, ammo);
        SCM(playerid, BIJELA, string);
        format(string, sizeof(string), ""COL_SVIJETLOPLAVA"| FriXion | "COL_CRVENA"Admin %s "COL_BIJELA"ti je dao oruzje "COL_SVIJETLOPLAVA"%s(%d) "COL_BIJELA"sa municijom "COL_SVIJETLOPLAVA"%i", adminime, ImenaOruzja, gun, ammo);
        SCM(id, BIJELA, string);
        format(string, sizeof(string), ""COL_CRVENA"|STAFF| %s "COL_BIJELA" je dao igracu "COL_SVIJETLOPLAVA" %s "COL_BIJELA"oruzje "COL_SVIJETLOPLAVA"%s(ID: %d)", adminime, igracime, ImenaOruzja, gun, ammo);
        StaffPoruka(BIJELA, string);
        GivePlayerWeapon(id, gun, ammo);
    }
    return 1;
}
Reply
#2

Hope i could understand this. Can someone please explain?
Reply
#3

Look when I gave somebody weapon it send them a SendClientMessage like this :

| FriXion | Admin Danny_Washburn give you weapon dsajidwa1q2e.

Now get?I wan't to be like this example :

| FriXion | Admin Danny_Washburn give you weapon Desert Eagle(1). //JUST EXAMPLE

Now do you get?
Reply
#4

[pawn] new id, gun, ammo, string[128], WeaponName[128] [pawn]
And in [pawn] ", WeaponName); [pawn] put that in there
Reply
#5

I don't understand this.
Reply
#6

Someone?
Reply
#7

HELP!!!!
Reply
#8

I made a new version of this command.But when I go on server and enter the commnand server is restarting and repeating when I give weapon(try to give) ID's of weapons: 1 - 47.

How ti fix that?Here is the command:

pawn Код:
CMD:dajoruzje(playerid, params[])
{
   new id, parametar, oruzje, municija, string[128], adminime[MAX_PLAYER_NAME], igracime[MAX_PLAYER_NAME];
   if(sscanf(params, "ui", id, parametar))
   {
            SCM(playerid, BIJELA, ""COL_SVIJETLOPLAVA"| FriXion | "COL_BIJELA"/dajoruzje [ID/Dio imena] [ID oruzja] [Municija(metci)]");
            if(PI[playerid][Admin] >=1 || IPA(playerid))
            {
                if(parametar < 1 || parametar > 47) return SCM(playerid, BIJELA, ""COL_SVIJETLOPLAVA"| FriXion | "COL_BIJELA"Oruzje ID-ovi : "COL_SVIJETLOPLAVA"1-47");
                if(parametar < 1 || parametar > 999) return SCM(playerid, BIJELA, ""COL_SVIJETLOPLAVA"| FriXion | "COL_BIJELA"Municija(metci) : "COL_SVIJETLOPLAVA"1-999");
            }
            return 1;
    }
    else
    {
        GetPlayerName(playerid, adminime, sizeof(adminime));
        adminime[strfind(adminime, "_")] = ' ';
        GetPlayerName(id, igracime, sizeof(igracime));
        DajOruzje(id, oruzje, municija);
        PI[playerid][Oruzje] = parametar;
        SCMF(playerid, BIJELA, ""COL_SVIJETLOPLAVA"| FriXion | "COL_BIJELA"Dao si igracu "COL_SVIJETLOPLAVA"%s "COL_BIJELA"oruzje "COL_SVIJETLOPLAVA"%s(%d)"COL_BIJELA"sa municijom "COL_SVIJETLOPLAVA"%i", igracime, WeaponName(parametar), parametar, oruzje, municija);
        SCMF(id, BIJELA,  ""COL_SVIJETLOPLAVA"| FriXion | "COL_CRVENA"Admin %s "COL_BIJELA"ti je dao oruzje "COL_SVIJETLOPLAVA"%s(%d) "COL_BIJELA"sa municijom "COL_SVIJETLOPLAVA"%i", adminime, WeaponName(parametar), parametar, oruzje, municija);
        format(string, sizeof(string), ""COL_CRVENA"|STAFF| "COL_BIJELA"Admin "COL_SVIJETLOPLAVA"%s "COL_BIJELA"je dao igracu "COL_SVIJETLOPLAVA"%s "COL_BIJELA"oruzje "COL_SVIJETLOPLAVA"%s(%d) "COL_BIJELA"sa municijom "COL_SVIJETLOPLAVA"%i", adminime, igracime, WeaponName(parametar), parametar, oruzje, municija);
        StaffPoruka(BIJELA, string);
    }
    return 1;
}
Reply
#9

Anybody?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)