MYSQL / OnPlayerLogin problem
#1

I have a mysql system based on Moderntopia RP system.

Well the problem its that all variables Save into the correct database Field with OnPlayerUpdate BUT if you disconnect and you login ( OnPlayerLogin ) ONLY the last database Fields go crazy.

This is the fields that go crazy:

pawn Код:
if (rcnt == 97) PlayerInfo[playerid][pNote1] = strmid(PlayerInfo[playerid][pNote1], Field, 0, strlen(Field)-1, 255);
            if (rcnt == 98) PlayerInfo[playerid][pNote1s] = strval(Field);
            if (rcnt == 99) PlayerInfo[playerid][pNote2] = strmid(PlayerInfo[playerid][pNote2], Field, 0, strlen(Field)-1, 255);
            if (rcnt == 100) PlayerInfo[playerid][pNote2s] = strval(Field);
            if (rcnt == 101) PlayerInfo[playerid][pNote3] = strmid(PlayerInfo[playerid][pNote3], Field, 0, strlen(Field)-1, 255);
            if (rcnt == 102) PlayerInfo[playerid][pNote3s] = strval(Field);
            if (rcnt == 103) PlayerInfo[playerid][pNote4] = strmid(PlayerInfo[playerid][pNote4], Field, 0, strlen(Field)-1, 255);
            if (rcnt == 104) PlayerInfo[playerid][pNote4s] = strval(Field);
            if (rcnt == 105) PlayerInfo[playerid][pNote5] = strmid(PlayerInfo[playerid][pNote5], Field, 0, strlen(Field)-1, 255);
            if (rcnt == 106) PlayerInfo[playerid][pNote5s] = strval(Field);
            if (rcnt == 107) PlayerInfo[playerid][pInvWeapon] = strval(Field);
            if (rcnt == 108) PlayerInfo[playerid][pInvAmmo] = strval(Field);
            if (rcnt == 109) PlayerInfo[playerid][pLighter] = strval(Field);
            if (rcnt == 110) PlayerInfo[playerid][pCigarettes] = strval(Field);
            if (rcnt == 111) PlayerInfo[playerid][pLocked] = strval(Field);
            if (rcnt == 112) PlayerInfo[playerid][ppint] = strval(Field);
            if (rcnt == 113) PlayerInfo[playerid][pBoxeo] = strval(Field);
            if (rcnt == 114) PlayerInfo[playerid][pKarate] = strval(Field);
For example you have in pInvWeapon == 1 when you disconnected and all but when you logged in it be crazy and say == 1 in other field that isn't pInvWeapon.

I revise the rcnt == number and all its correct :S for sure!

What the hell is goin on?

Please, I need help. Thanks for all.
Reply
#2

All of the variables you use strmid you can remove the =, for example:
From this:
PlayerInfo[playerid][pNote1] = strmid(PlayerInfo[playerid][pNote1], Field, 0, strlen(Field)-1, 255);
to this:
strmid(PlayerInfo[playerid][pNote1], Field, 0, strlen(Field)-1, 255);
Reply
#3

Further reading:

https://sampwiki.blast.hk/wiki/Strmid
Reply
#4

Thanks for all help I will try fix the bug .
Reply
#5

I don't found the problem but I quit the Note1, etc and all works perfect.

What the hell is goin on :S
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)