0 Members and 1 Guest are viewing this topic.
procedure create(ID:Byte; Name,Password:String);begin writeln('-- create init'); if not fileExists('Accounts/'+Name+'.txt') then begin writeln('-- create saving'); saveAccount(ID,Name,Password); writeln('-- create loading'); loadAccount(ID,Name,Password); writeConsole(ID,'*** Account successfully created ***',accountCl); writeln('-- create createpet'); createPet(Name); writeln('-- create summonpet'); summonPet(ID); end else writeConsole(ID,'*** Account already exists ***',errorCl); writeln('-- create done');end;
-- create init-- create saving-- create loading [Error] ZS -> (OnPlayerCommand): '' is not a valid integer value
function loadAccount(ID:Byte; Name,Password:String):Byte;var AccountData:String;begin result:=0; writeln('-- load init'); if (FileExists('Accounts/'+Name+'.txt')) then begin writeln('-- load read'); AccountData:=readAccount(Name); if (GetPiece(AccountData,' ',0)=Password) then begin writeln('-- load fill record'); player[ID].accountName:=Name; player[ID].accountPassword:=Password; player[ID].level:=strToInt(getPiece(AccountData,' ',1)); player[ID].ep:=strToInt(getPiece(AccountData,' ',2)); player[ID].statPoints:=strToInt(getPiece(AccountData,' ',3)); player[ID].skillPoints:=strToInt(getPiece(AccountData,' ',4)); player[ID].money:=strToInt(getPiece(AccountData,' ',5)); player[ID].petPoints:=strToInt(getPiece(AccountData,' ',6)); writeln('-- load summon pet'); summonPet(ID); end else result:=2; end else result:=1; writeln('-- load done');end;
-- create init-- create saving-- create loading-- load init-- load read-- load fill record-- load summon pet [Error] ZS -> (OnPlayerCommand): '' is not a valid integer value
procedure summonPet(ID:Byte);var Data:String; pID:Byte;begin writeln('-- summonpet init'); Data:=readAccount(player[ID].accountName+'_'); writeln('-- data: ' + data); writeln('-- summonpet addbot'); pID:=command('/addbot'+intToStr(getPlayerStat(ID,'Team'))+' Zombie'); player[ID].petID:=pID; pet[pID].level:=strToInt(getPiece(Data,' ',0)); pet[pID].ep:=strToInt(getPiece(Data,' ',1)); pet[pID].ownerID:=ID; writeConsole(ID,'petID:'+intToStr(pID)+' - lvl:'+intToStr(pet[pID].level)+' - ep:'+intToStr(pet[pID].ep),$FFFFFF);end;
-- create init-- create saving-- create loading-- load init-- load read-- load fill record-- load summon pet-- summonpet init-- data:-- summonpet addbot [Error] ZS -> (OnPlayerCommand): '' is not a valid integer value