19.02.2010, 09:28
Код:
if(dialogid == 21) { TogglePlayerControllable(playerid, 0); new pName[24], str[128]; GetPlayerName(playerid, pName, sizeof(pName)); format(str, sizeof(str),"players/%s.ini",pName); new PW[256]; PW = dini_Get(str,"password"); if(response == 1) { if(strval(inputtext) == udb_hash(PW)) // successful login { pstat[playerid][skin] = dini_Int(str,"skin"); pstat[playerid][cash] = dini_Int(str,"cash"); pstat[playerid][bank] = dini_Int(str,"bank"); pstat[playerid][posX] = dini_Int(str,"posX"); pstat[playerid][posY] = dini_Int(str,"posY"); pstat[playerid][posZ] = dini_Int(str,"posZ"); GivePlayerMoney(playerid, pstat[playerid][cash]); SetPlayerSkin(playerid, pstat[playerid][skin]); SetPlayerPos(playerid, pstat[playerid][posX], pstat[playerid][posY], pstat[playerid][posZ]); } else { ShowPlayerDialog(playerid, 21, 1,"Wrong Password", "That Password is incorrect. Please try again.","Login", "cancel"); } return 1; } }
Also this:
Код:
public OnPlayerDisconnect(playerid, reason) { new pName[24], str[128]; GetPlayerName(playerid,pName,sizeof(pName)); format(str,sizeof(str),"players/%s.ini",pName); new string2[256]; new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof(playername)); format(string2, sizeof(string2), "%s has left the server.",playername); SendClientMessage(playerid, COLOR_TAN , string2); new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); new GetCash = GetPlayerMoney(playerid); dini_IntSet(str,"cash",GetCash); dini_IntSet(str,"bank",0); dini_FloatSet(str,"posX",x); dini_FloatSet(str,"posY",y); dini_FloatSet(str,"posZ",z); return 1; }
Also, if someone could tell me a way to bypass character selection?
When a player chose their skin first time, when they die (even if they pressed F4) they DO NOT go to the class selection but spawn with their same stats at a position I chose?
THANKS - If you wanna help me. Means a lot, can't continue working without this fixed!