SA-MP Forums Archive
/duel - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /duel (/showthread.php?tid=315213)



/duel - [LTU]mindux9[TCS] - 02.02.2012

You can help fix that allow the introduction of not only the opponent's ideas, but also for Price

Code:
dcmd_duel(playerid, params[])
{
	new tmp[256], tmp2[256], idx;
	tmp = strtok(params, idx);
	IDSended = playerid;
	IDInvited = strval(tmp);
	DuelPrice = strval(tmp2);
	
	if(!strlen(tmp))
	{
	    SendClientMessage(IDSended, RED, "-Wrong Command- {FFFFFF}USE: /duel [id]");
		}else if(InDuel[IDSended]==1){
	    SendClientMessage(IDSended, RED, "-Error- {FFFFFF}You're in a duel.");
		}else if(InDuel[IDInvited]==1){
	    SendClientMessage(IDSended, RED, "-Error- {FFFFFF}The other person is in a duel.");
		}else if(!IsPlayerConnected(IDInvited)){
	    SendClientMessage(IDSended, RED, "-Error- {FFFFFF}This player is not connected.");
		}else if(IDInvited == playerid)
		{
	    SendClientMessage(IDSended, RED, "-Error- {FFFFFF}You can not duel with himself.");
	}else{
		if(!strlen(tmp2))
		{
   		}else if(GetPlayerMoney(playerid) < DuelPrice || 0 >= DuelPrice)
	    {
	    SendClientMessage(IDSended, RED, "-Error-");
	    }else{
	    new StringInv[512], Name[64];
		GetPlayerName(IDSended, Name, 64);
		format(StringInv, sizeof(StringInv), "%s is calling you to a challenge. %d", Name, DuelPrice);
        ShowPlayerDialog(IDInvited, DIALOG_INVITE, DIALOG_STYLE_MSGBOX, "Called the challenge", StringInv, "Accept", "Cancel");
	}
	}
	return 1;
}



Re: /duel - [LTU]mindux9[TCS] - 02.02.2012

need help!