skin changes when dieing o_o
#1

hello there...


i recently made the skin save when you log out of the server...

but now the only problem i have is that when i die...my skin changes to the cop skin when i spawn back

anyways...just to shed alittle light, The cop skin is on the FIRST slot on the class selection screen...(if that helps)

heres my code:


this one is to the "LOGIN dialog"

when you login you automaticly spawn with the skin you had last time


Quote:

if(dialogid == LOG)
{

new string[128];
new name[MAX_PLAYER_NAME];

{
new file[128];
new PlayerName[24];
new giveplayerid;
if(strlen(inputtext) == 0)
{
GetPlayerName(playerid, PlayerName, sizeof PlayerName);
format(string, sizeof string, "We have detected that your account is registered \n\nPlease login to your account", PlayerName);
ShowPlayerDialog(playerid, LOG, DIALOG_STYLE_INPUT, "Account", string, "Login", "Cancel.");
return 0;
}
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/USERS/%s.ini",name);
if(fexist(file))
{
new password = dini_Int(file, "Password");
if(udb_hash(inputtext) != password)
{
SendClientMessage(playerid, COLOR_ERROR, "Incorrect password");
format(string, sizeof string, "We have detected that your account is registered \n\nPlease login to your account", name);
ShowPlayerDialog(playerid, LOG, DIALOG_STYLE_INPUT, "Account", string, "Login", "Cancel.");
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));

}
else
{
IsLogged[playerid] = 1;

SpawnPlayer(playerid);
SetPlayerScore(playerid, dini_Int(file,"Score"));
GivePlayerMoney(playerid, dini_Int(file,"Money"));
PlayerInfo[giveplayerid][AdminLevel] = dini_Int(file,"AdminLevel");
gTeam[playerid] = dini_Int(file,"Team");
SetPlayerSkin(playerid, dini_Int(file, "Skin"));


SendClientMessage(playerid, COLOR_GREEN, "You have successfully logged into your account");
}
}
}
}

return 1;
}


and this one saves your info such as skin,money etc when you disconnect


Quote:

public OnPlayerDisconnect(playerid, reason)
{
new pName[24];
new str[128];
new giveplayerid;
GetPlayerName(playerid, pName, 24);

switch(reason)
{
case 0: format(str, 128, "%s has left the server. (Timeout)", pName);
case 1: format(str, 128, "%s has left the server. (Leaving)", pName);
case 2: format(str, 128, "%s has left the server. (Kicked)", pName);
}
SendClientMessageToAll(0xAFAFAFAA, str);

new file[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/USERS/%s.ini",name);

if(fexist(file))
{
dini_IntSet(file,"Score", GetPlayerScore(playerid));
dini_IntSet(file,"Money", GetPlayerMoney(playerid));
dini_IntSet(file,"AdminLevel", PlayerInfo[giveplayerid][AdminLevel]);
dini_IntSet(file,"Team", gTeam[playerid]);
new skin=GetPlayerSkin(playerid);
dini_IntSet(file, "Skin", skin);


}

IsLogged[playerid] = 0;
KillTimer(TimeTimer);



return 1;
}


everything save perfectly...it just when i get killed ingame and then when i spawn back...u spawn with the cop skin...


thats the only problem i have...so please...if u can solve this for me ill give you a gigantic cookie throgh FEDEX
Reply


Messages In This Thread
skin changes when dieing o_o - by Owenlishious - 23.06.2010, 21:59
Re: skin changes when dieing o_o - by Babul - 23.06.2010, 22:07
Re: skin changes when dieing o_o - by Owenlishious - 23.06.2010, 22:11
Re: skin changes when dieing o_o - by Babul - 23.06.2010, 22:22
Re: skin changes when dieing o_o - by Owenlishious - 23.06.2010, 22:28
Re: skin changes when dieing o_o - by Babul - 23.06.2010, 22:38
Re: skin changes when dieing o_o - by Owenlishious - 23.06.2010, 22:54
Re: skin changes when dieing o_o - by Babul - 23.06.2010, 23:14
Re: skin changes when dieing o_o - by Owenlishious - 24.06.2010, 00:26

Forum Jump:


Users browsing this thread: 1 Guest(s)