Hey Leute,
wenn ich meine Stats anschauen möchte
ocmd:stats(playerid,params[])
ocmd:stats(playerid,params[])
{
if (GetPVarInt(playerid,"Perso") == 1)
{
Statistiken(playerid,playerid);
return 1;
}
else
{
SCM(playerid,RED,"Du musst dir erst einen Personalausweis in der Stadthalle machen lassen.");
return 1;
}
}
Kommen diese Fehlermeldungen:
[10:47:34] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[10:47:34] [debug] Stack pointer (STK) is 0x13933C, heap pointer (HEA) is 0x13A1A8
[10:47:34] [debug] AMX backtrace:
[10:47:34] [debug] #0 000a1674 in public ocmd_stats (playerid=0, params[]=@0013a1a0 " ") at D:\Domi\Spiele\GTA San Andreas\Selfmade\gamemodes\inventar.pwn:16412
[10:47:34] [debug] #1 native CallLocalFunction () from samp-server.exe
[10:47:34] [debug] #2 000a1674 in public OnPlayerCommandText (playerid=0, cmdtext[]=@0013a1a0 " ") at D:\Domi\Spiele\GTA San Andreas\Selfmade\gamemodes\inventar.pwn:16412
Die ominöse Zeile 16412:
ocmd:stats(playerid,params[])
{
if (GetPVarInt(playerid,"Perso") == 1)
{
Statistiken(playerid,playerid);
return 1; // <--- ZEILE 16412
}
else
{
SCM(playerid,RED,"Du musst dir erst einen Personalausweis in der Stadthalle machen lassen.");
return 1;
}
}
Der komplette Statistiken Stock:
stock Statistiken(fromplayerid,forplayerid)
{
new fraktname[64];
new adminlevel[64];
new jtext[20];
new htext[20];
new ehren[21];
new vtext[20];
new drank[20];
new Float:KnastZGinMIN = GetPVarInt(fromplayerid,"KnastzeitGesamt") / 60;
new Float:KnastZGinSTD = KnastZGinMIN / 60;
switch(GetPVarInt(fromplayerid,"Job"))
{
case 0:(jtext="arbeitslos");
case 1:(jtext="Pilot");
case 2:(jtext="Taxifahrer");
case 3:(jtext="Waffendealer");
case 4:(jtext="Müllmann");
case 5:(jtext="Lieferant");
case 6:(jtext="Stuntman");
case 7:(jtext="Anwalt");
case 8:(jtext="Hacker");
case 99:(jtext="Harz IV");
}
switch(GetPVarInt(fromplayerid,"Adminlevel"))
{
case 0:(adminlevel="-");
case 1:(adminlevel="Supporter");
case 2:(adminlevel="Moderator");
case 3:(adminlevel="Administrator");
case 4:(adminlevel="High-Admin");
case 5:(adminlevel="Head-Admin");
case 6:(adminlevel="Projektleiter");
}
switch(GetPVarInt(fromplayerid,"Telefon"))
{
case 0:{htext="-";}
case 1:{htext="Nokia 3420";}
case 2:{htext="HTC One";}
case 3:{htext="Samsung S5";}
case 4:{htext="Nokia Lumia";}
case 5:{htext="Sony Z3 LTE";}
case 6:{htext="iPhone 6";}
}
switch(GetPVarInt(fromplayerid,"Fraktion"))
{
case 0:(fraktname="Zivilist");
case 1:(fraktname=fraktname1);
case 2:(fraktname=fraktname2);
case 3:(fraktname=fraktname3);
case 4:(fraktname=fraktname4);
case 5:(fraktname=fraktname5);
case 6:(fraktname=fraktname6);
case 7:(fraktname=fraktname7);
case 8:(fraktname=fraktname8);
case 9:(fraktname=fraktname9);
case 10:(fraktname=fraktname10);
case 11:(fraktname=fraktname11);
case 12:(fraktname=fraktname12);
case 13:(fraktname=fraktname13);
}
switch(GetPVarInt(fromplayerid,"Gesellschaft"))
{
case 0:{ehren="Bürger von S.A.";}
case 1:{ehren="Staatsfeind";}
case 2:{ehren="Kaptitalist";}
case 3:{ehren="Ehrenbürger von S.A.";}
}
switch(GetPVarInt(fromplayerid,"Versicherung"))
{
case 0:{vtext="keine";}
case 1:{vtext="L.S. Insurance";}
case 2:{vtext="L.S.I. Help";}
case 3:{vtext="Life' Inc.";}
}
switch(GetPVarInt(fromplayerid,"Donator"))
{
case 0:{drank="-";}
case 1:{drank="Bronze";}
case 2:{drank="Silber";}
case 3:{drank="Gold";}
case 4:{drank="Platin";}
}
new string1[200],string2[200],string3[200],string4[200],string5[200],string6[200],string7[200],string8[200],string9[200],string10[200],rest[2500];
format(string1, sizeof string1, "{BDBDBD} Statistik von {FF00FF} %s {BDBDBD} auf {FF00FF}German Infinity Reallife",SpielerName(fromplayerid));
format(string2, sizeof string2, "{0000FF}[Allgemeines]");
format(string3, sizeof string3, "{FF00FF}Level: {00FFFF}%i {FF00FF}Respektpunkte:{00FFFF} %d/%i {FF00FF}Skin ID: {00FFFF}%i {FF00FF}Tode: {00FFFF}%d {FF00FF}Morde: {00FFFF}%d {FF00FF}Verbechen: {00FFFF}%d", GetPlayerScore(fromplayerid),GetPVarInt(fromplayerid,"Respektpunkte"),GetPVarInt(fromplayerid,"RespektpunkteBenötigt"),GetPlayerSkin(fromplayerid),GetPVarInt(fromplayerid,"Tode"),GetPVarInt(fromplayerid,"Kills"),GetPVarInt(fromplayerid,"Verbrechen"));
format(string4, sizeof string4, "{FF00FF}Adminrank:{00FFFF} %s {FF00FF}Verwarnungen:{00FFFF} %d {FF00FF}Gesellschaft:{00FFFF} %s",adminlevel,GetPVarInt(fromplayerid,"Verwarungen"),ehren);
format(string5, sizeof string5, "{FF00FF}Beruf:{00FFFF} %s {FF00FF}Fraktion:{00FFFF} %s {FF00FF}Donator-Rank:{00FFFF} %s ",jtext,fraktname,drank);
format(string6, sizeof string6, "{0000FF}[Besitztum]");
format(string7, sizeof string7, "{FF00FF}Bargeld:{00FFFF} %d {FF00FF}Kontoguthaben:{00FFFF} %d "/*{FF00FF}Haus:{00FFFF} %s */"{FF00FF}Lottonummer:{00FFFF} %d",GetPVarInt(fromplayerid,"Geld"),GetPVarInt(fromplayerid,"Bank")/*,hauss*/,GetPVarInt(fromplayerid,"Lotto"));
format(string8, sizeof string8, "{FF00FF}Coins:{00FFFF} %d {FF00FF}Versicherung:{00FFFF} %s {FF00FF}Handy:{00FFFF} %s {FF00FF}Handy Nr.:{00FFFF} %d",GetPVarInt(fromplayerid,"Coins"),vtext,htext,GetPVarInt(fromplayerid,"Nummer"));
format(string9, sizeof string9, "{0000FF}[Fakten]");
format(string10, sizeof string10, "{FF00FF}ges. Knastzeit:{00FFFF} \t%.1fmin. {FF00FF}Online-Zeit:{00FFFF} %i Std.{00FFFF} {FF00FF}Zahltag:{00FFFF} %i min. her ",KnastZGinSTD,GetPVarInt(fromplayerid,"Spielzeit"),GetPVarInt(fromplayerid,"ZSPD"));
format(rest, sizeof rest, "%s\n\n\n%s\n\n%s\n%s\n%s\n\n\n%s\n\n%s\n%s\n\n%s\n\n%s\n\n%s\n%s\n%s\n%s", string1,string2,string3,string4,string5,string6,string7,string8,string9,string10);
ShowPlayerDialog(forplayerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"Statistik-System 1.0",rest,"OK","");
}
Hinweis: *Es kommt auch InGame die Nachricht "Uknow Command" also ein return 1;
Daraufhin steht in der Console (server.log) die oben stehenden Fehlermeldungen
Seht ihr den Fehler?!