SA-MP Forums Archive
What happens? - 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: What happens? (/showthread.php?tid=590823)



What happens? - norton2 - 04.10.2015

Fpunish problem!
Код HTML:
ShowStats(playerid, targetid)
{
    printf("FP3: %d", pInfo[targetid][pFPunish]);
    if(IsPlayerConnected(targetid))
    {
        format(szStats, sizeof(szStats), "Rank: %d | FPunish: %d/60 | FWarn: %d/3", pInfo[targetid][pRank], pInfo[targetid][pRank], pInfo[targetid][pFPunish], pInfo[targetid][pFWarns]);
        SendClientMessage(playerid, 0xADADADFF, szStats);
        printf("FP4: %d", pInfo[targetid][pFPunish]);
    }
    return 1;
}
Код HTML:
FP3: 0
FP4: 0 
(0 is right value)
ShowStats In Game:
Код HTML:
Rank: 2 | FPunish: 6/60 | FWarn: 0/3
FPunish is 0, not 6.


Re: What happens? - AbyssMorgan - 04.10.2015

Код:
format(szStats, sizeof(szStats), "Rank: %d | FPunish: %d/60 | FWarn: %d/3", pInfo[targetid][pRank], pInfo[targetid][pFPunish], pInfo[targetid][pFWarns]);
duplicate 'pInfo[targetid][pRank]'


Re: What happens? - norton2 - 04.10.2015

Duplicate pRank and now:
Код HTML:
Rank: 2 | FPunish: 2/60 | FWarn: 0/3



Re: What happens? - norton2 - 04.10.2015

My problem is similar to this: https://sampforum.blast.hk/showthread.php?tid=573211
I reset the variables 0 to OnPlayerConnect but still not work!


Re: What happens? - Bartels - 04.10.2015

Quote:
Originally Posted by norton2
Посмотреть сообщение
Duplicate pRank and now:
Код HTML:
Rank: 2 | FPunish: 2/60 | FWarn: 0/3
I'm not sure what you did to get that, but I'm positive this should work:

Код:
ShowStats(playerid, targetid)
{
    printf("FP3: %d", pInfo[targetid][pFPunish]);
    if(IsPlayerConnected(targetid))
    {
        format(szStats, sizeof(szStats), "Rank: %d | FPunish: %d/60 | FWarn: %d/3", pInfo[targetid][pRank], pInfo[targetid][pFPunish], pInfo[targetid][pFWarns]);
        SendClientMessage(playerid, 0xADADADFF, szStats);
        printf("FP4: %d", pInfo[targetid][pFPunish]);
    }
    return 1;
}



Re: What happens? - norton2 - 04.10.2015

Quote:
Originally Posted by Bartels
Посмотреть сообщение
I'm not sure what you did to get that, but I'm positive this should work:

Код:
ShowStats(playerid, targetid)
{
    printf("FP3: %d", pInfo[targetid][pFPunish]);
    if(IsPlayerConnected(targetid))
    {
        format(szStats, sizeof(szStats), "Rank: %d | FPunish: %d/60 | FWarn: %d/3", pInfo[targetid][pRank], pInfo[targetid][pFPunish], pInfo[targetid][pFWarns]);
        SendClientMessage(playerid, 0xADADADFF, szStats);
        printf("FP4: %d", pInfo[targetid][pFPunish]);
    }
    return 1;
}
Thanks you man!! +1 REP!