[HELP] OnPlayerConnect to textdraw update
#1

Hi all, i have a problem with login system, This is how it looks like. http://imgur.com/S0Xsduc
It should show me when i join the server my level, donator rank, job [posao], organisation [organizacija]. As you can see level and donator rank are 0 although i am 30 level and donator rank 5 or so. Also i have a job and i am in organisation but it does not shows me my job and my organisation.
Код:
//I put this on OnPlayerConnect
PlayerTextDrawSetPreviewModel(playerid,LoginRegs5[playerid], GetPlayerSkin(playerid));
PlayerTextDrawShow(playerid,LoginRegs5[playerid]);
new imea[50];
format(imea,sizeof(imea),"%s",GetName(playerid));
PlayerTextDrawSetString(playerid,LoginRegs13[playerid], imea);
PlayerTextDrawShow(playerid,LoginRegs13[playerid]);
new levela[50];
format(levela,sizeof(levela),"%d",PlayerInfo[playerid][pLevel]);
PlayerTextDrawSetString(playerid,LoginRegs14[playerid], levela);
PlayerTextDrawShow(playerid,LoginRegs14[playerid]);
new posoooo[50];
format(posoooo,sizeof(posoooo),"%s",PlayerInfo[playerid][pJob]);
PlayerTextDrawSetString(playerid,LoginRegs16[playerid], posoooo);
PlayerTextDrawShow(playerid,LoginRegs16[playerid]);
new orgaz[50];
format(orgaz,sizeof(orgaz),"%s",PlayerInfo[playerid][pMember]);
PlayerTextDrawSetString(playerid,LoginRegs17[playerid],orgaz);
PlayerTextDrawShow(playerid,LoginRegs17[playerid]);
new dona[50];
format(dona,sizeof(dona),"%d",PlayerInfo[playerid][pVip]);
PlayerTextDrawSetString(playerid,LoginRegs15[playerid],dona);
PlayerTextDrawShow(playerid,LoginRegs15[playerid]);
Reply
#2

Perhaps you load your PlayerInfo AFTER this code?
Reply
#3

Pod Onplayerconnect? watch image http://imgur.com/S0Xsduc
Reply
#4

Quote:
Originally Posted by Amads
Посмотреть сообщение
Perhaps you load your PlayerInfo AFTER this code?
Amads want to say that, you are reseting the variables before the textdraws, like this:



PHP код:
PlayerInfo[playerid][pLevel] = 0;
PlayerInfo[playerid][pJob] = 0;
PlayerInfo[playerid][pMember] = 0;
and 
then you use:
PlayerTextDrawSetPreviewModel(playerid,LoginRegs5[playerid], GetPlayerSkin(playerid));
PlayerTextDrawShow(playerid,LoginRegs5[playerid]);
new 
imea[50];
format(imea,sizeof(imea),"%s",GetName(playerid));
PlayerTextDrawSetString(playerid,LoginRegs13[playerid], imea);
PlayerTextDrawShow(playerid,LoginRegs13[playerid]);
new 
levela[50];
format(levela,sizeof(levela),"%d",PlayerInfo[playerid][pLevel]);
PlayerTextDrawSetString(playerid,LoginRegs14[playerid], levela);
PlayerTextDrawShow(playerid,LoginRegs14[playerid]);
new 
posoooo[50];
format(posoooo,sizeof(posoooo),"%s",PlayerInfo[playerid][pJob]);
PlayerTextDrawSetString(playerid,LoginRegs16[playerid], posoooo);
PlayerTextDrawShow(playerid,LoginRegs16[playerid]);
new 
orgaz[50];
format(orgaz,sizeof(orgaz),"%s",PlayerInfo[playerid][pMember]);
PlayerTextDrawSetString(playerid,LoginRegs17[playerid],orgaz);
PlayerTextDrawShow(playerid,LoginRegs17[playerid]);
new 
dona[50];
format(dona,sizeof(dona),"%d",PlayerInfo[playerid][pVip]);
PlayerTextDrawSetString(playerid,LoginRegs15[playerid],dona);
PlayerTextDrawShow(playerid,LoginRegs15[playerid]); 
Also, i think this will not work because, the player must login/register, to load their Dates from your Database.
Just if you use Auto-Login and put this after the Auto-Login function. That's my opinion.
Reply
#5

how the server works http://imgur.com/WSxuZIr
Reply
#6

Do you use Mysql ?
Reply
#7

No bro mysql help bro pls
Reply
#8

You should just load your data before the textdraws, like
Код:
LoadUser(playerid); //Or whatever it is
//Textdraws
Now, i don't know your login system, i don't know which type of file manager you use so i couldn't help too much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)