duel sys
#1

The duel system I downloaded was originally suppose to be with 1 weapon selection only!

So I tried to make it 2 weapon

(e.g: /duel id weap1 weap2)

and for some reason I don't get the second weapon

Код:
new WeaponInfo[][sWeaponInfo] =
{
    {"Fist",1,0},
    {"Shotgun",25,3},
    {"Deagle",24,2}

};
p.s the weap2[85] is the custom one I made yeah.

Код:
CMD:duel(playerid, params[])
{
    new user, weap[85],weap2[85], weaponid = -1, string[128], string2[128] ;
    if(sscanf(params, "uss[90]", user, weap, weap2)) return SendClientMessage(playerid, -1, "{00cc00}(INFO) /duel [id] [weapon1] [weapon2]");
    if(user == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) That player is offline!");
    if(user == playerid) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) You can't duel yourself!");
    if(duelinfo[playerid][induel] == 1) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) You're already in a duel!");
    if(duelinfo[user][induel] == 1) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) That player is already dueling somebody!");
    if(invite[user] == 1) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) That player has already received a duel invitation!");
    if(inviter[playerid] == 1) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) You have already invited someone! (/cancelrequest) to cancel the invitation!)");
    if(StringNumeric(weap))
    {
        weaponid = strval(weap);
    }
    if(StringNumeric(weap2))
    {
        weaponid = strval(weap2);
	}
    else
    {
        weaponid = CheckWeaponID(weap);
        weaponid = CheckWeaponID(weap2);
    }
    DuelSender[user] = playerid;
    duelinfo[playerid][weapid] = weaponid;
    duelinfo[playerid][weapname] = weap;
    duelinfo[playerid][weapname] = weap2;
    duelinfo[user][weapid] = weaponid;
    duelinfo[user][weapname] = weap;
    duelinfo[user][weapname] = weap2;
    invite[user] = 1;
    inviter[playerid] = 1;
    DuelReciever[playerid] = user;
    format(string, sizeof(string), "{00CC00}(DUEL) You have sent a duel invitation to %s (Weapon: %s and %s)", duelinfo[user][playername], user, weap, weap2);
    SendClientMessage(playerid, -1, string);
    format(string2, sizeof(string2), "{00cc00}(DUEL) You have received a duel invitation from %s(ID:%d) (Weapon: %s and %s) (/accept, /decline)", duelinfo[playerid][playername], playerid, weap, weap2);
    SendClientMessage(user, -1, string2);
    return 1;
}
CMD:accept(playerid, params[])
{
    if(invite[playerid] == 1)
    {
        new user = DuelSender[playerid];
        ResetPlayerWeapons(user);
        RemovePlayerFromVehicle(user);
        SetPlayerArmour(user, 100);
        SetPlayerHealth(user, 100);
        SetPlayerVirtualWorld(user, 100);
        SetPlayerPos(user, 1266.6100,2729.2917,10.8203);
        GivePlayerWeapon(user, duelinfo[playerid][weapid], 1000);
        GivePlayerWeapon(playerid, duelinfo[playerid][weapid], 1000);
        duelinfo[user][induel] = 1;
        inviter[user] = 0;

        ResetPlayerWeapons(playerid);
        RemovePlayerFromVehicle(playerid);
        SetPlayerArmour(playerid, 100);
        SetPlayerHealth(playerid, 100);
        SetPlayerVirtualWorld(playerid, 100);
        GivePlayerWeapon(playerid, duelinfo[user][weapid], 1000);
        GivePlayerWeapon(playerid, duelinfo[user][weapid], 1000);
        SetPlayerPos(playerid, 1272.0603,2857.6536,10.8203);
        duelinfo[playerid][induel] = 1;
        invite[playerid] = 0;
    }
    else return SendClientMessage(playerid, -1, "{c3c3c3}(DUEL) You didn't recieve any duel request");
    return 1;
}
Reply


Messages In This Thread
duel sys - by ivndosos - 16.02.2018, 09:32
Re: duel sys - by kingmk - 16.02.2018, 09:38
Re: duel sys - by ivndosos - 16.02.2018, 10:11
Re: duel sys - by PepsiCola23 - 16.02.2018, 11:57
Re: duel sys - by Mugala - 16.02.2018, 12:26
Re: duel sys - by ivndosos - 16.02.2018, 12:58
Re: duel sys - by ivndosos - 17.02.2018, 09:29
Re: duel sys - by Mugala - 17.02.2018, 09:34
Re: duel sys - by PepsiCola23 - 17.02.2018, 09:38

Forum Jump:


Users browsing this thread: 1 Guest(s)