CMD:duel(playerid,params[])
{
new target;
if(pInfo[playerid][Minigame] == 1) return sMess(playerid,4);
if(pInfo[playerid][Dinviter] != -1) return SendClientMessage(playerid,Red,"** You already have an invitation from player!");
if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"**Usage: /duel <playerid>");
if(pInfo[target][Dinviter] != -1) return SendClientMessage(playerid,Red,"** Target have an invitation from player!");
if(pInfo[target][InDuel] == 1) return SendClientMessage(playerid,Red,"** Target already in duel!");
if(pInfo[playerid][InDuel] == 1) return SendClientMessage(playerid,Red,"** You are already in duel!");
pInfo[playerid][Dinviter] = target;
ShowPlayerDialog(playerid, DIALOG_DUEL, DIALOG_STYLE_LIST,"Select duel wepaon", "Sawn-off\nDeagle\nUzi", "Ok", "Back");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
// duel
if(dialogid == DIALOG_DUEL && response)
{
switch(dialogid)
{
case 0:
{
new ms[500];
new target = pInfo[playerid][Dinviter];
// target = player id invited for duel!
// playerid = inviter
format(ms,500,"{808080}["WI"DUEL-INVITE{808080}] : Player %s is inviting you for duel Sawn-Off!",GetName(playerid));
SendClientMessage(target,-1,ms); // This message for player invite for duel!
SendClientMessage(target,-1,"==>> Type /yes if you want to duel!"); // This message for player invite for duel!
SendClientMessage(playerid,-1,"** Please wait for target accepting your request!"); // This message for inviter!
pInfo[target][Dinviter] = playerid;
pInfo[target][DuelType] = 1;
pInfo[playerid][DuelType] = 1;
SetTimerEx("ResetD",10000,0,"dd",pInfo[playerid][Dinviter],playerid);
}
case 1:
{
}
case 2:
{
}
}
if(!response)
{
pInfo[playerid][Dinviter] = -1;
}
}
return 1;
}
if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"**Usage: /duel <playerid>"); |
target = strval(params); |
switch(dialogid)
switch(listitem)