12.02.2013, 21:38
Quote:
pawn Код:
Why not use the GetVehicleName function? pawn Код:
This is what I have in my gm, might help you. pawn Код:
|
Код:
{ new hashpass[129], pCarName[64]; format(pCarName, sizeof(pCarName),"%s'%s", PlayerInfo[playerid][UserName], PlayerInfo[playerid][CarName]); WP_Hash(hashpass, sizeof(hashpass), inputtext); if(!strcmp(hashpass, PlayerInfo[playerid][Password])) { SendClientMessage(playerid, 0x00FF00FF,"You have succesfully logged in.\nWelcome back to a Bum's Life!"); pCarName = CreateVehicle(PlayerInfo[playerid][CarID], PlayerInfo[playerid][CarX], PlayerInfo[playerid][CarY], PlayerInfo[playerid][CarZ], PlayerInfo[playerid][CarA], PlayerInfo[playerid][CarCol1], PlayerInfo[playerid][CarCol2], 0); Finished = 1; } else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","{FF0000}You have entered an Incorrect password!\n{FFFFFF}Please enter your Correct password to login.","Login","Quit"); return 1; } return 1; } return 1;
Oh and my Enum looks like this...
Код:
enum PlayerData { UserName[MAX_PLAYER_NAME], Password[129], Float:PosX, Float:PosY, Float:PosZ, Float:PosA, Interior, VirtualWorld, Skin, Wallet, Bank, CarName[32], CarID, CarVW, CarI, Float:CarX, Float:CarY, Float:CarZ, Float:CarA, CarCol1, CarCol2 } new PlayerInfo[MAX_PLAYERS][PlayerData];
Код:
stock Save_Info(playerid) { GetPlayerPos(playerid, PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ]); GetPlayerFacingAngle(playerid, PlayerInfo[playerid][PosA]); new INI:File = INI_Open(PPath(playerid)); INI_SetTag(File,"Player_Data"); INI_WriteFloat(File,"PosX", PlayerInfo[playerid][PosX]); INI_WriteFloat(File,"PosY", PlayerInfo[playerid][PosY]); INI_WriteFloat(File,"PosZ", PlayerInfo[playerid][PosZ]); INI_WriteFloat(File,"PosA", PlayerInfo[playerid][PosA]); INI_WriteInt(File,"VirtualWorld", GetPlayerVirtualWorld(playerid)); INI_WriteInt(File,"Interior", GetPlayerInterior(playerid)); INI_WriteInt(File,"Skin", GetPlayerSkin(playerid)); INI_WriteInt(File,"Wallet", PlayerInfo[playerid][Wallet]); INI_WriteInt(File,"Bank", PlayerInfo[playerid][Bank]); INI_WriteString(File,"CarName", PlayerInfo[playerid][CarName]); INI_WriteInt(File,"CarID", PlayerInfo[playerid][CarID]); INI_WriteInt(File,"CarVW", PlayerInfo[playerid][CarVW]); INI_WriteInt(File,"CarI", PlayerInfo[playerid][CarI]); INI_WriteFloat(File,"CarX", PlayerInfo[playerid][CarX]); INI_WriteFloat(File,"CarY", PlayerInfo[playerid][CarY]); INI_WriteFloat(File,"CarZ", PlayerInfo[playerid][CarZ]); INI_WriteFloat(File,"CarA", PlayerInfo[playerid][CarA]); INI_WriteInt(File,"CarColor1", PlayerInfo[playerid][CarCol1]); INI_WriteInt(File,"CarColor2", PlayerInfo[playerid][CarCol2]); INI_Close(File); }