26.03.2014, 17:36
Took me some time but found it:
Then change this:
Delete your previous account and create a new one.
pawn Code:
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Bank",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Skin",159);
INI_WriteInt(File,"NewReg",0);
INI_WriteInt(File,"Xpos",0);
INI_WriteInt(File,"Ypos",0);
INI_WriteInt(File,"Zpos",0);
INI_Close(File);
SetPlayerSkin(playerid, 159); // Sets the player skin
SpawnPlayer(playerid);
PlayerInfo[playerid][NewReg] = 1;
}
}
pawn Code:
public OnPlayerSpawn(playerid)
{
if(PlayerInfo[playerid][NewReg] == 0)
{
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); print("Stage 40");
SetPlayerPos(playerid, PlayerInfo[playerid][Xpos], PlayerInfo[playerid][Ypos], PlayerInfo[playerid][Zpos]+0.3); print("Stage 41");
}
else
{
SetPlayerPos(playerid, X, Y, Z); // CHANGE THIS FOR FIRST PLAYER SPAWN WHEN HE ENTERS THE GAME
}
print("Stage 42");
return 1;
}