Duel System bugged
#1

The problem of my duel system is that it doesn't show the player he asked for the duel the information:

PHP код:
format(stringsizeof(string), "You have been invited to a %s duel by %s. /ad to accept or /dd to deny"modeDuelInfo[did][Host]);
                    
SendClientMessage(dinvitee[playerid][i], 0x0000FFFFstring); 
whole duel pastebin
PASTEBIN
Reply
#2

oh my god this code is sooo bad...
maybe first try to change 'return 1;' to 'continue' at line 242.

Код:
new mode[6 + 1];
for(new i=0; i<8; i++)
{
    if(!IsPlayerConnected(i))
    	continue;

    if(DuelInfo[did][Mode] == 1) format(mode, sizeof mode, "1 v 1");
    if(DuelInfo[did][Mode] == 2) format(mode, sizeof mode, "2 v 2");
    if(DuelInfo[did][Mode] == 3) format(mode, sizeof mode, "3 v 3");
    if(DuelInfo[did][Mode] == 4) format(mode, sizeof mode, "4 v 4");
    
    format(string, sizeof(string), "You have been invited to a %s duel by %s. /ad to accept or /dd to deny", mode, DuelInfo[did][Host]);
    SendClientMessage(dinvitee[playerid][i], 0x0000FFFF, string);
    printf("%i", dinvitee[playerid][i]);
}
Reply
#3

Sorry about the messiness of the code.

The printed value is
65535
Reply
#4

65535 is the value of INVALID_PLAYER_ID means 'non-connected player'.
Reply
#5

Now that makes sense, thanks
Reply
#6

then you should use

Код:
 if(!IsPlayerConnected(dinvitee[playerid][i]))
instead of

Код:
 if(!IsPlayerConnected(i))
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)