SA-MP Forums Archive
Weird issue - 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: Weird issue (/showthread.php?tid=648804)



Weird issue - aoky - 28.01.2018

PHP код:
        switch(Account[playerid][DuelType])
        {
            case 
0:
            {
                
format(duelmsgsizeof(duelmsg), "DUEL: %s has won the duel against %s at %s! (Bet: %d)"GetName(killerid), GetName(playerid), duelMapNameList[Account[playerid][Map]], Account[Account[playerid][DuelInviter]][Bet]);
                
GivePlayerMoneyEx(killeridAccount[Account[playerid][DuelInviter]][Bet] * 2);
                
SendClientMessageToAll(pCOLOR_LIGHTBLUEduelmsg);
                
CompleteDuel(playeridkillerid); 
If the person that started the duel kills the person he invited, that case 0 is called.

But, if the person who was invited kills the person who sent the duel nothing is called.

Both of their variables are the same.

note: I know this is horribly written, it's just for testing


Re: Weird issue - R4nd4ll - 28.01.2018

Код HTML:
switch(Account[playerid][DuelType]) 
        { 
            case 0: 
            { 
                new duelmsg[128];
                format(duelmsg, sizeof(duelmsg), "DUEL: %s has won the duel against %s at %s! (Bet: %d)", GetName(killerid), GetName(playerid), duelMapNameList[Account[playerid][Map]], Account[Account[playerid][DuelInviter]][Bet]); 
                GivePlayerMoneyEx(killerid, Account[Account[playerid][DuelInviter]][Bet] * 2); 
                SendClientMessageToAll(pCOLOR_LIGHTBLUE, duelmsg); 
                CompleteDuel(playerid, killerid);
I think that you didnt declare duelmsg ?

Idk, try it and tell me if it's working or not.

Edit : I am talking about the msg that's being sent to everyone.
Edit #2 : If that's not what are you talking about, Then please describe the problem.


Re: Weird issue - aoky - 28.01.2018

There aren't any errors, don't worry about that.

It's just, I should of explained it better lol.

If the person that started the duel kills the person he invited, that case 0 is called.

But, if the person who was invited kills the person who sent the duel nothing is called.

Both of their variables are the same.


Re: Weird issue - R4nd4ll - 28.01.2018

Can you show us the full code ? (Not the full script of course lmao)


Re: Weird issue - Cypress - 28.01.2018

Did you already debug that code? Set the variable of the player who was invited which is Account[playerid][DuelType] to 0 as well?

I would check if it gets called when a player in a duel dies, for both, killerid and playerid, if not means variables are messed up.


Re: Weird issue - Mugala - 29.01.2018

so if I understand what u want to do, u want to duel inviter's type be 1,than put this variable at invitation code: Account[inviter'sid][DuelType] = 1;