PDA

View Full Version : Save Classes Not Teams


[D]ry[D]esert
06/05/2012, 12:23 PM
Hello Every One
I got Zombie Server and i want i have Classes I want Save Class When Player Reloge like Cash Admin level and Sore
i try this but whats after i don't know i want define 1 as Medic i mean
enum Classes
{
ZombieClass
ZombieClassNumber
HumanClassNumber
HumanClass
};
new Classes[MAX_PLAYERS][Classes];
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",AccountInfo[playerid][Password]);
INI_Int("Admin",AccountInfo[playerid][AdminLevel]);
INI_Int("Cash",AccountInfo[playerid][Cash]);
INI_Int("Score",AccountInfo[playerid][Score]);
INI_Int("ZombieClass",Classes[playerid][ZombieClass]);
INI_Int("HumanClass",Classes[playerid][HumanClass]);
return 1;
}
stock SaveStats(playerid)
{
if(IsPlayerConnected(playerid))
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",AccountInfo[playerid][Password]);
INI_WriteInt(File,"Admin",AccountInfo[playerid][AdminLevel]);
INI_WriteInt(File,"Cash",AccountInfo[playerid][Cash]);
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_Int("ZombieClass",Classes[playerid][ZombieClassNumber]);
INI_Int("HumanClass",Classes[playerid][HumanClassNumber]);
INI_Close(File);
}
}
Whats After ?

[D]ry[D]esert
06/05/2012, 12:39 PM
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == Class)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerScore(playerid) < 250) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You don't have enough Score");
{
if (gTeam[playerid] == TEAM_ZOMBIES)
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"You are Zombie you can't Choose human Classes");
}
if (gTeam[playerid] == TEAM_HUMANS)
{
HumanClass[playerid] = Civilian;
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,23,200);
GivePlayerWeapon(playerid,4,200);
SetPlayerSkin(playerid,289);
}
}


}
if(listitem == 1)
{
if(GetPlayerScore(playerid) < 750) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You don't have enough Score");
{
if (gTeam[playerid] == TEAM_ZOMBIES)
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"You are Zombie you can't Choose human Classes");
}
if (gTeam[playerid] == TEAM_HUMANS)
{
HumanClass[playerid] = Police;
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,5,200);
GivePlayerWeapon(playerid,25,200);
SetPlayerSkin(playerid,282);
}
}
}
if(listitem == 2)
{
if(GetPlayerScore(playerid) < 1500) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You don't have enough Score");
{
if (gTeam[playerid] == TEAM_ZOMBIES)
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"You are Zombie you can't Choose human Classes");
}
if (gTeam[playerid] == TEAM_HUMANS)
{
HumanClass[playerid] = Sniper;
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,6,200);
GivePlayerWeapon(playerid,34,200);
SetPlayerSkin(playerid,123);
}
}
}
if(listitem == 3)
{
if(GetPlayerScore(playerid) < 3000) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You don't have enough Score");
{
if (gTeam[playerid] == TEAM_ZOMBIES)
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"You are Zombie you can't Choose human Classes");
}
if (gTeam[playerid] == TEAM_HUMANS)
{

HumanClass[playerid] = Swat;
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,3,200);
GivePlayerWeapon(playerid,29,200);
SetPlayerSkin(playerid,285);
}
}
}
if(listitem == 4)
{
if(GetPlayerScore(playerid) < 5600) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You don't have enough Score");
{
if (gTeam[playerid] == TEAM_ZOMBIES)
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"You are Zombie you can't Choose human Classes");
}
if (gTeam[playerid] == TEAM_HUMANS)
{

HumanClass[playerid] = Detonator;
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,35,2);
GivePlayerWeapon(playerid,25,200);
GivePlayerWeapon(playerid,39,10);
SetPlayerSkin(playerid,28);
}
}
}
if(listitem == 5)
{
if(GetPlayerScore(playerid) < 7000) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You don't have enough Score");
{
if (gTeam[playerid] == TEAM_ZOMBIES)
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"You are Zombie you can't Choose human Classes");
}
if (gTeam[playerid] == TEAM_HUMANS)
{
HumanClass[playerid] = Medic;
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,23,200);
GivePlayerWeapon(playerid,25,200);
SetPlayerArmour(playerid,25.0);
GivePlayerWeapon(playerid,17,10);
SetPlayerSkin(playerid,274);
}
}
}
if(listitem == 6)
{
if(GetPlayerScore(playerid) < 14000) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You don't have enough Score");
{
if (gTeam[playerid] == TEAM_ZOMBIES)
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"You are Zombie you can't Choose human Classes");
}
if (gTeam[playerid] == TEAM_HUMANS)
{
HumanClass[playerid] = Army;
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,24,200);
GivePlayerWeapon(playerid,30,200);
SetPlayerSkin(playerid,287);
}
}
}
if(listitem == 7)
{
if(GetPlayerScore(playerid) < 24000) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You don't have enough Score");
{
if (gTeam[playerid] == TEAM_ZOMBIES)
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"You are Zombie you can't Choose human Classes");
}
if (gTeam[playerid] == TEAM_HUMANS)
{
HumanClass[playerid] = Engineer;
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,27,200);
GivePlayerWeapon(playerid,29,200);
GivePlayerWeapon(playerid,9,200);
SetPlayerSkin(playerid,27);
}
}
}
if(listitem == 8)
{
if(GetPlayerScore(playerid) < 30000) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You don't have enough Score");
{
if (gTeam[playerid] == TEAM_ZOMBIES)
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"You are Zombie you can't Choose human Classes");
}
if (gTeam[playerid] == TEAM_HUMANS)
{
HumanClass[playerid] = Destroyer;
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,27,200);
GivePlayerWeapon(playerid,38,200);
SetPlayerSkin(playerid,73);
}
}
}

}
else return SendClientMessage(playerid,COLOR_BRIGHTRED,"No Team Has been selected");
}
}