14.10.2011, 18:02
I Don't Know What it Is Some Reason When ever ID 0 OR 1 Dies Both of them Re-spawn.... Its Confusing I looked over the code Twenty times changed it around still the same... I have No Clue....
And When ever Another Player Joins Im Respawned with the other player and we both free fall from BlueBerry
I Don't Know What part Of the Code I Should Show...
There Nothing In OnPlayerDeath
And When ever Another Player Joins Im Respawned with the other player and we both free fall from BlueBerry
I Don't Know What part Of the Code I Should Show...
pawn Код:
forward OnPlayerLogged(playerid);
public OnPlayerLogged(playerid)
{
new name[MAX_PLAYER_NAME], file[256], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), ARS_ACCOUNTS, name);
PlayerInfo[playerid][pAccount] = dini_Int(file,"Account");
PlayerInfo[playerid][pAdminLevel] = dini_Int(file,"AdminLevel");
PlayerInfo[playerid][pCash] = dini_Int(file, "Money");
PlayerInfo[playerid][pScore] = dini_Int(file, "Level");
PlayerInfo[playerid][pFirstname] = dini_Int(file, "Firstname");
PlayerInfo[playerid][pLastname] = dini_Int(file, "Lastname");
PlayerInfo[playerid][pAge] = dini_Int(file, "Age");
PlayerInfo[playerid][pGender] = dini_Int(file, "Gender");
PlayerInfo[playerid][pReg] = dini_Int(file, "Registration");
PlayerInfo[playerid][pHouse] = dini_Int(file, "House");
PlayerInfo[playerid][pId] = dini_Int(file, "SSN");
PlayerInfo[playerid][pFrank] = dini_Int(file, "FireRank");
PlayerInfo[playerid][pPrank] = dini_Int(file, "PoliceRank");
PlayerInfo[playerid][pFireTeam] = dini_Int(file, "FireTeam");
PlayerInfo[playerid][pPoliceTeam] = dini_Int(file, "PoliceTeam");
PlayerInfo[playerid][pMedicTeam] = dini_Int(file, "MedicTeam");
PlayerInfo[playerid][pHealth] = dini_Int(file, "Health");
PlayerInfo[playerid][pArmour] = dini_Int(file, "Armour");
PlayerInfo[playerid][pCharacter] = dini_Int(file, "Character");
PlayerInfo[playerid][pLocX] = dini_Int(file, "LocX");
PlayerInfo[playerid][pLocY] = dini_Int(file, "LocY");
PlayerInfo[playerid][pLocZ] = dini_Int(file, "LocZ");
PlayerInfo[playerid][pLocA] = dini_Int(file, "LocA");
PlayerInfo[playerid][pLocI] = dini_Int(file, "LocI");
PlayerInfo[playerid][pLocW] = dini_Int(file, "LocW");
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
SetPlayerSkin(playerid, PlayerInfo[playerid][pCharacter]);
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SafeSetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
format(string, 128, "You Have Successfully Logged In With Account. %s ", name);
SendClientMessage(playerid, ORANGE, string);
SpawnLastSaved(playerid);
PlayerOnline[playerid] = 1;
return 1;
}
pawn Код:
public SaveUserAccounts(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerOnline[playerid] == 1)
{
new file[24];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), ARS_ACCOUNTS, name);
dini_IntSet(file, "Account",PlayerInfo[playerid][pAccount]);
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
dini_IntSet(file, "Money",PlayerInfo[playerid][pCash]);
dini_IntSet(file, "Level",PlayerInfo[playerid][pScore]);
dini_IntSet(file, "Firstname",PlayerInfo[playerid][pFirstname]);
dini_IntSet(file, "Lastname",PlayerInfo[playerid][pLastname]);
dini_IntSet(file, "Age",PlayerInfo[playerid][pAge]);
dini_IntSet(file, "Gender",PlayerInfo[playerid][pGender]);
dini_IntSet(file, "Registration",PlayerInfo[playerid][pReg]);
dini_IntSet(file, "House",PlayerInfo[playerid][pHouse]);
dini_IntSet(file, "SSN",PlayerInfo[playerid][pId]);
dini_IntSet(file, "FireRank",PlayerInfo[playerid][pFrank]);
dini_IntSet(file, "PoliceRank",PlayerInfo[playerid][pPrank]);
dini_IntSet(file, "FireTeam",PlayerInfo[playerid][pFireTeam]);
dini_IntSet(file, "PoliceTeam",PlayerInfo[playerid][pPoliceTeam]);
dini_IntSet(file, "MedicTeam",PlayerInfo[playerid][pMedicTeam]);
dini_FloatSet(file, "Health",PlayerInfo[playerid][pHealth]);
dini_FloatSet(file, "Armour",PlayerInfo[playerid][pArmour]);
dini_IntSet(file, "Character",PlayerInfo[playerid][pCharacter]);
dini_IntSet(file, "LocX",PlayerInfo[playerid][pLocX]);
dini_IntSet(file, "LocY",PlayerInfo[playerid][pLocY]);
dini_IntSet(file, "LocZ",PlayerInfo[playerid][pLocZ]);
dini_IntSet(file, "LocA",PlayerInfo[playerid][pLocA]);
dini_IntSet(file, "LocI",PlayerInfo[playerid][pLocI]);
dini_IntSet(file, "LocW",PlayerInfo[playerid][pLocW]);
}
}
}
pawn Код:
forward SpawnLastSaved(playerid);
public SpawnLastSaved(playerid)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), ARS_ACCOUNTS, name);
SetPlayerPos(playerid, dini_Float(file, "LocX"),dini_Float(file,"LocY"),dini_Float(file,"LocZ"));
SetPlayerFacingAngle(playerid,dini_Float(file,"LocA"));
SetPlayerInterior(playerid,dini_Int(file,"LocI"));
SpawnPlayer(playerid);
return 1;
}
pawn Код:
public SavePlayerPos(playerid)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), ARS_ACCOUNTS, name);
new Float:X, Float:Y, Float:Z, Float:A, Float:I, Float:W;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
I = GetPlayerInterior(playerid);
W = GetPlayerVirtualWorld(playerid);
dini_FloatSet(file, "LocX", X);
dini_FloatSet(file, "LocY", Y);
dini_FloatSet(file, "LocZ", Z);
dini_FloatSet(file, "LocA", A);
dini_FloatSet(file, "LocI", I);
dini_FloatSet(file, "LocW", W);
dini_IntSet(file, "LocI", GetPlayerInterior(playerid));
dini_IntSet(file, "LocW", GetPlayerVirtualWorld(playerid));
return 1;
}
There Nothing In OnPlayerDeath