duel sys
#7

bump ^ that issue and

if i invite someone, i get 2 weapons but he gets 1

Код:
CMD:duel(playerid, params[])
{
    new user, weap[85],weap2[85], weaponid = -1, weaponid2 = -1,string[250], string2[250] ;
    if(sscanf(params, "uss[128]", user, weap, weap2)) return SendClientMessage(playerid, -1, "{00cc00}(INFO) /Duel [ID/Player Name] [Weapon Name 1] [Weapon Name 2]");
    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(IsPlayerInLobby[user] == 1) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) That player is in lobby!");
    if(InArena1[user] == 1) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) That player is in arena!");
    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);
	weaponid2 = CheckWeaponID(weap2);
    }
    duelinfo[playerid][weapid2] = weaponid2;
    DuelSender[user] = playerid;
    duelinfo[playerid][weapid] = weaponid;
    duelinfo[playerid][weapname] = weap;
    duelinfo[playerid][weapname2] = weap2;
    duelinfo[user][weapid] = weaponid;
	duelinfo[user][weapname] = weap;
	duelinfo[user][weapname2] = weap2;
    invite[user] = 1;
    inviter[playerid] = 1;
    DuelReciever[playerid] = user;
    format(string, sizeof(string), "{00CC00}(DUEL) You have sent a duel invitation to %s (with %s and %s)", duelinfo[user][playername], weap, weap2);
    SendClientMessage(playerid, -1, string);
    format(string2, sizeof(string2), "{00cc00}(DUEL) You have received a duel invitation from %s(ID:%d) (with %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[user][weapid], 1000);
		GivePlayerWeapon(user, duelinfo[user][weapid2], 1000);
        duelinfo[user][induel] = 1;
        inviter[user] = 0;

        ResetPlayerWeapons(playerid);
        RemovePlayerFromVehicle(playerid);
        SetPlayerArmour(playerid, 100);
        SetPlayerHealth(playerid, 100);
        SetPlayerVirtualWorld(playerid, 100);
        GivePlayerWeapon(playerid, duelinfo[playerid][weapid], 1000);
		GivePlayerWeapon(playerid, duelinfo[playerid][weapid2], 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)