MYSQL / OnPlayerLogin problem - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MYSQL / OnPlayerLogin problem (
/showthread.php?tid=124419)
MYSQL / OnPlayerLogin problem -
CTCCoco - 30.01.2010
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.
Re: MYSQL / OnPlayerLogin problem -
MenaceX^ - 30.01.2010
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);
Re: MYSQL / OnPlayerLogin problem -
ray187 - 30.01.2010
Further reading:
https://sampwiki.blast.hk/wiki/Strmid
Re: MYSQL / OnPlayerLogin problem -
CTCCoco - 30.01.2010
Thanks for all help

I will try fix the bug .
Re: MYSQL / OnPlayerLogin problem -
CTCCoco - 30.01.2010
I don't found the problem but I quit the Note1, etc and all works perfect.
What the hell is goin on :S