18.07.2013, 11:37
Hello,
I've some issues with my loading system, when the player spawn, he didn't spawn in the correct position, in the correct.
Thanks for your help.
I've some issues with my loading system, when the player spawn, he didn't spawn in the correct position, in the correct.
pawn Код:
enum pInfo {
pId,
pNom,
pPassword,
pNiveau,
pExp,
pBan,
pBraison,
pAge,
pSexe,
pSpawnX,
pSpawnY,
pSpawnZ,
pSpawnVw,
pSpawnInt,
pArgent,
pBanque,
pAdmin,
pMail,
pSkin,
pTutoriel,
pLogged,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
pawn Код:
public OnQueryFinish(query[], resultid, extraid, connectionHandle)
{
mysql_store_result();
new type = resultid;
new playerid = extraid;
if(type == QUERY_LOGIN)
{
if(mysql_num_rows() != 0)
{
if(mysql_fetch_row_format(query, "|"))
{
sscanf(query,"e<p<|>s[24]s[32]iii>", PlayerInfo[playerid]);
Spawn(playerid);
}
}
else
{
new str[256];
format(str, sizeof(str),"Mot de passe invalide.");
TextDrawSetString(errormsg1[playerid],str);
}
}
pawn Код:
public Spawn(playerid)
{
new str[80];
format(str, sizeof(str),"Bienvenue %s.",PlayerInfo[playerid][pNom]);
SendClientMessage(playerid, COLOR_BLUE, str);
TogglePlayerControllable(playerid,1);
CancelSelectTextDraw(playerid);
PlayerInfo[playerid][pLogged] = 1;
TextDrawHideForPlayer(playerid,box0);
TextDrawHideForPlayer(playerid,box1);
TextDrawHideForPlayer(playerid,titre1[playerid]);
TextDrawHideForPlayer(playerid,msg1[playerid]);
TextDrawHideForPlayer(playerid,msg2[playerid]);
TextDrawHideForPlayer(playerid,errormsg1[playerid]);
TextDrawHideForPlayer(playerid,suivant);
SetPlayerPos(playerid,PlayerInfo[playerid][pSpawnX],PlayerInfo[playerid][pSpawnY],PlayerInfo[playerid][pSpawnZ]);
SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pSpawnVw]);
SetPlayerInterior(playerid,PlayerInfo[playerid][pSpawnInt]);
SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
}