Hey Leute ich arbeite gerade an einem Exp System, jedoch braucht man viele Zeilen
und ich wollte fragen ob ich das nicht irgendwie anders machen könnte, weil ich glaube
so zieht es viele Ressoursen. (Info: der Exp Anstieg ist 200)
stock CheckExp(playerid)
{
new Exp=GetPVarInt(playerid,"Exp");
new lvl=GetPlayerScore(playerid);
if(lvl==1)
{
if(Exp>=100)
{
SetPVarPlus(playerid,"Exp",-100);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,string);
}
}
else if(lvl==2)
{
if(Exp>=300)
{
SetPVarPlus(playerid,"Exp",-300);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,string);
}
}
else if(lvl==3)
{
if(Exp>=500)
{
SetPVarPlus(playerid,"Exp",-500);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,string);
}
}
else if(lvl==4)
{
if(Exp>=700)
{
SetPVarPlus(playerid,"Exp",-700);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,string);
}
}
else if(lvl==5)
{
if(Exp>=900)
{
SetPVarPlus(playerid,"Exp",-900);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,string);
}
}
else if(lvl==6)
{
if(Exp>=1200)
{
SetPVarPlus(playerid,"Exp",-1200);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,string);
}
}
else if(lvl==7)
{
if(Exp>=1400)
{
SetPVarPlus(playerid,"Exp",-1400);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,string);
}
}
else if(lvl==8)
{
if(Exp>=1600)
{
SetPVarPlus(playerid,"Exp",-1600);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,string);
}
}
else if(lvl==9)
{
if(Exp>=1800)
{
SetPVarPlus(playerid,"Exp",-1800);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,string);
}
}
else if(lvl==10)
{
if(Exp>=2000)
{
SetPVarPlus(playerid,"Exp",-2000);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,string);
}
}
else if(lvl==11)
{
if(Exp>=2200)
{
SetPVarPlus(playerid,"Exp",-2200);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,string);}
}
else if(lvl==12)
{
if(Exp>=2400)
{
SetPVarPlus(playerid,"Exp",-2400);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,string);
}
}
else if(lvl==13)
{
if(Exp>=2600)
{
SetPVarPlus(playerid,"Exp",-2600);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,string);
}
}
else if(lvl==14)
{
if(Exp>=2800)
{
SetPVarPlus(playerid,"Exp",-2800);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,string);
}
}
else if(lvl==15)
{
if(Exp>=3000)
{
SetPVarPlus(playerid,"Exp",-3000);
GivePlayerScore(playerid,1);
new string[124];
format(string,sizeof(string),"Du hast das Level %i erreicht.",GetPlayerScore(playerid));
SendClientMessage(playerid,Rot2,"Du hast somit das höchste Level erreicht.");
SendClientMessage(playerid,Rot2,string);
}
}
return 1;
}
Wäre toll wenn mir jemand helfen könnte.