#1

Why does the condition is executed only "playerid", and for the "Duel [playerid]" not? Help please.

Cause the player to a duel:
Код:
if(listitem == 1)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(clickp[playerid], pName, sizeof(pName));
	format(string,sizeof string,"Игрок %s(%i) вызывает Вас на дуэль\nВы согласны?",pName,playerid);
    ShowPlayerDialog(Duel[playerid],AccDuel,DIALOG_STYLE_MSGBOX,"Вызов на дуэль:",string,"Принять","Отклонить");
}
}
}
Accept / Reject a duel:
Код:
	if(dialogid == AccDuel)
{
	if(response)
{
    if(!strlen(inputtext))
    Duel[playerid] = strval(inputtext);
	Duel[Duel[playerid]] = playerid;
    ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,31,9999);
	GivePlayerWeapon(playerid,24,9999);
	GivePlayerWeapon(playerid,25,9999);
	SetPlayerHealth(playerid, 100);
	SetPlayerArmour(playerid, 100);
	SetPlayerPos(playerid,2105.8318,2428.2993,45.2188);
	//
	ResetPlayerWeapons(Duel[playerid]);
	GivePlayerWeapon(Duel[playerid],31,9999);
	GivePlayerWeapon(Duel[playerid],24,9999);
	GivePlayerWeapon(Duel[playerid],25,9999);
	SetPlayerHealth(Duel[playerid], 100);
	SetPlayerArmour(Duel[playerid], 100);
	SetPlayerPos(Duel[playerid],2060.2151,2385.5791,45.2265);
}
	else
{
    Duel[Duel[playerid]] = INVALID_PLAYER_ID;
	Duel[playerid] = INVALID_PLAYER_ID;
	SendClientMessage(playerid,-1,"Игрок решил не принимать участие в дуэли.");
	SendClientMessage(Duel[playerid],-1,"Вы решили не принимать участие в дуэли.");
}
	return 1;
}
Reply
#2

Quote:
Originally Posted by [HHT]DRON
Посмотреть сообщение
pawn Код:
ResetPlayerWeapons(Duel[playerid]);
    GivePlayerWeapon(Duel[playerid],31,9999);
    GivePlayerWeapon(Duel[playerid],24,9999);
    GivePlayerWeapon(Duel[playerid],25,9999);
    SetPlayerHealth(Duel[playerid], 100);
    SetPlayerArmour(Duel[playerid], 100);
    SetPlayerPos(Duel[playerid],2060.2151,2385.5791,45.2265);
Change to this

pawn Код:
ResetPlayerWeapons(Duel[Duel[playerid]]);
    GivePlayerWeapon(Duel[Duel[playerid]],31,9999);
    GivePlayerWeapon(Duel[Duel[playerid]],24,9999);
    GivePlayerWeapon(Duel[Duel[playerid]],25,9999);
    SetPlayerHealth(Duel[Duel[playerid]], 100);
    SetPlayerArmour(Duel[Duel[playerid]], 100);
    SetPlayerPos(Duel[Duel[playerid]],2060.2151,2385.5791,45.2265);
also change this

pawn Код:
Duel[Duel[playerid]] = INVALID_PLAYER_ID;
    Duel[playerid] = INVALID_PLAYER_ID;
    SendClientMessage(playerid,-1,"Игрок решил не принимать участие в дуэли.");
    SendClientMessage(Duel[Duel[playerid]],-1,"Вы решили не принимать участие в дуэли.");
}
I hope I fixed your bug.
Reply
#3

Код:
if(listitem == 1)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(clickp[playerid], pName, sizeof(pName));
    format(string,sizeof string,"Игрок %s(%i) вызывает Вас на дуэль\nВы согласны?",pName,playerid);
    ShowPlayerDialog(Duel[playerid],AccDuel,DIALOG_STYLE_MSGBOX,"Вызов на дуэль:",string,"Принять","Отклонить");
}
}
}
Then right? I have done through the click in the TAB.
When I call a player, you just teleport it (if you take the call), but I do not help to fix it.
Reply
#4

pawn Код:
if(listitem == 1)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string,sizeof string,"Игрок %s(%i) вызывает Вас на дуэль\nВы согласны?",pName,playerid);
    ShowPlayerDialog(clickp[playerid],AccDuel,DIALOG_STYLE_MSGBOX,"Вызов на дуэль:",string,"Принять","Отклонить");
}
}
}
Edit:I'm lost, could you tell me in order what you did. I guess your trying: Click on a player in TAB, then showing a dialog to the player to ask him with which player you want to duel?? I'll change all your codes to make it understandable and to work. Good night
Reply
#5

You press the player in TAB and then showing a dialog: Statistics \ Challenge \ Write PM.
Reply
#6

Now it should work, I understand what you were trying to do, why did you put strlen(inputtext) and strval(inputtext) in a DIALOG_MSGBOX? You'll need to translate it back to your language at some places. I tested the script just to be sure it will work now.

pawn Код:
new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    new string[130];
    Duel[clickedplayerid] = playerid;
    format(string,sizeof string,"Игрок %s(%i) вызывает Вас на дуэль\nВы согласны?",pName,playerid);
    ShowPlayerDialog(clickedplayerid,AccDuel,DIALOG_STYLE_MSGBOX,"Вызов на дуэль:",string,"Принять","Отклонить");
Also

pawn Код:
if(dialogid == AccDuel)
    {
        if(response)
        {
            if(Duel[playerid] == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"The player left the game, impossible to do a duel with him.");
            ResetPlayerWeapons(playerid);
            GivePlayerWeapon(playerid,31,9999);
            GivePlayerWeapon(playerid,24,9999);
            GivePlayerWeapon(playerid,25,9999);
            SetPlayerHealth(playerid, 100);
            SetPlayerArmour(playerid, 100);
            SetPlayerPos(playerid,2105.8318,2428.2993,45.2188);
            //
            ResetPlayerWeapons(Duel[playerid]);
            GivePlayerWeapon(Duel[playerid],31,9999);
            GivePlayerWeapon(Duel[playerid],24,9999);
            GivePlayerWeapon(Duel[playerid],25,9999);
            SetPlayerHealth(Duel[playerid], 100);
            SetPlayerArmour(Duel[playerid], 100);
            SetPlayerPos(Duel[playerid],2060.2151,2385.5791,45.2265);
        }
        else
        {
            new string[128], pName[MAX_PLAYER_NAME], pSendername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pName, sizeof(pName));
            GetPlayerName(Duel[playerid], pSendername, sizeof(pSendername));
            if(Duel[playerid] == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"The player left the game, impossible to decline the duel.");
            format(string, sizeof(string), "You declined the duel of %s.", pSendername);
            SendClientMessage(playerid,-1,string);
            format(string, sizeof(string), "%s declined your duel invitation", pName);
            SendClientMessage(Duel[playerid],-1,string);
        }
    }
Edit: Much easier to fix when you understand something
Reply
#7

Errors:
Код:
D:\Games\SAMP сервер\SampDM\gamemodes\SampDMv.1.3.pwn(5137) : error 017: undefined symbol "clickedplayerid"
D:\Games\SAMP сервер\SampDM\gamemodes\SampDMv.1.3.pwn(5139) : error 017: undefined symbol "clickedplayerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Код:
Duel[clickedplayerid] = playerid;
ShowPlayerDialog(clickedplayerid,AccDuel,DIALOG_STYLE_MSGBOX,"Вызов на дуэль:",string,"Принять","Отклонить");
Reply
#8

so right?
Код:
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    Duel[clickp[playerid]] = playerid;
    format(string,sizeof string,"Игрок %s(%i) вызывает Вас на дуэль\nВы согласны?",pName,playerid);
    ShowPlayerDialog(clickp[playerid],AccDuel,DIALOG_STYLE_MSGBOX,"Вызов на дуэль:",string,"Принять","Отклонить");
Reply
#9

You said you placed it in when a player clicks a player in TAB.

public OnPlayerClickPlayer(playerid, clickedplayerid, source)

So it shouldn't return you an undefined symbol.

Edit:
Quote:
Originally Posted by [HHT]DRON
Посмотреть сообщение
You press the player in TAB and then showing a dialog: Statistics \ Challenge \ Write PM.
Where did you placed it then?
Reply
#10

Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	clickp[playerid] = clickedplayerid;
	ShowPlayerDialog(playerid,clickplmenu,DIALOG_STYLE_LIST,"Меню игрока","Посмотреть статистику\nВызвать на дуэль\nНаписать личное сообщение","OK","Закрыть");
	return 1;
}
У меня все работает! =)
Help please do a background check that would cause the player could not himself to a duel.

Код:
new pName[MAX_PLAYER_NAME];
    if(Duel[clickp[playerid]]  == playerid) return SendError(playerid, "Вы не можете вызвать на дуэль самого себя!");
    GetPlayerName(playerid, pName, sizeof(pName));
    Duel[clickp[playerid]] = playerid;
    g_GotInvitedToDuel[clickp[playerid]] = playerid;
	g_HasInvitedToDuel[playerid] = 1;
    format(string,sizeof string,"Игрок %s(%i) вызывает Вас на дуэль\nВы согласны?",pName,playerid);
    ShowPlayerDialog(clickp[playerid],AccDuel,DIALOG_STYLE_MSGBOX,"Вызов на дуэль:",string,"Принять","Отклонить");
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)