Jump to content
  • 0

pomoc Mám problém s připojení


linanohaahuba

Dotaz

Popis problému:

 

[13:50:30] [connection] 193.164.219.41:59577 requests connection cookie.

[13:50:31] [connection] incoming connection: 193.164.219.41:59577 id: 0

[13:50:31] [join] [ARW]_ZooFX has joined the server (0:193.164.219.41)

[13:50:31] [debug] Server crashed while executing NovyGM.amx

[13:50:31] [debug] AMX backtrace:

[13:50:31] [debug] #0 native fread () from 6925svr

[13:50:31] [debug] #1 0005eadc in ?? (0) from NovyGM.amx

[13:50:31] [debug] #2 00005110 in public OnPlayerConnect (0) from NovyGM.amx

[13:50:31] [debug] Native backtrace:

[13:50:31] [debug] #0 f7409180 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () from plugins/crashdetect.so

[13:50:31] [debug] #1 f7401064 in _ZN11CrashDetect20PrintNativeBacktraceERSoRKN2os7ContextE () from plugins/crashdetect.so

[13:50:31] [debug] #2 f7401d64 in _ZN11CrashDetect20PrintNativeBacktraceERKN2os7ContextE () from plugins/crashdetect.so

[13:50:31] [debug] #3 f7403cdb in _ZN11CrashDetect7OnCrashERKN2os7ContextE () from plugins/crashdetect.so

[13:50:31] [debug] #4 f74084d5 in ?? () from plugins/crashdetect.so

[13:50:31] [debug] #5 f7769d50 in __kernel_rt_sigreturn () from linux-gate.so.1

[13:50:31] [debug] #6 f7769d70 in __kernel_vsyscall () from linux-gate.so.1

[13:50:31] [debug] #7 f7460367 in gsignal () from /lib/i386-linux-gnu/i686/cmov/libc.so.6

[13:50:31] [debug] #8 f7461a23 in abort () from /lib/i386-linux-gnu/i686/cmov/libc.so.6

[13:50:31] [debug] #9 f74596c7 in ?? () from /lib/i386-linux-gnu/i686/cmov/libc.so.6

[13:50:31] [debug] #10 f7459777 in ?? () from /lib/i386-linux-gnu/i686/cmov/libc.so.6

[13:50:31] [debug] #11 0809b7a1 in ?? () from ./6925svr

[13:50:31] [debug] #12 0809bf43 in ?? () from ./6925svr

[13:50:31] [debug] #13 080950e4 in ?? () from ./6925svr

[13:50:31] [debug] #14 f7402ad3 in _ZN11CrashDetect17HandleAMXCallbackEiPiS0_ () from plugins/crashdetect.so

[13:50:31] [debug] #15 0000001d in ?? () from rHr4a4a5a4aaa4a4s

[13:50:31] [debug] Registers:

[13:50:31] [debug] EAX: 00000000 EBX: 00006d50 ECX: 00006d50 EDX: 00000006

[13:50:31] [debug] ESI: f7757000 EDI: f75db000 EBP: fff9b498 ESP: fff9b284

[13:50:31] [debug] EIP: f7769d70 EFLAGS: 00000296

[13:50:31] [debug] Stack:

[13:50:31] [debug] ESP+00000000: fff9b498 00000006 00006d50 f7460367

[13:50:31] [debug] ESP+00000020: fff9b2b4 00000000 31303150 fff9b2f0

[13:50:31] [debug] ESP+00000040: 00000000 00000000 00000000 00000000

[13:50:31] [debug] ESP+00000060: 00000000 00000000 00000000 00000000

[13:50:31] [debug] ESP+00000080: 00000000 00000000 00000000 00000000

[13:50:31] [debug] ESP+000000a0: 00000000 00000000 00000000 00000000

[13:50:31] [debug] ESP+000000c0: f75dc144 ffffffff 00000000 00000043

[13:50:31] [debug] ESP+000000e0: fff9b388 fff9b380 08049bfb 00000004

[13:50:31] [debug] ESP+00000100: 08158b66 f75db420 f749f0fe f75db960

[13:50:31] [debug] ESP+00000120: f75db000 f75db960 00000000 00000003

[13:50:31] [debug] ESP+00000140: f75db000 08158b66 f74596c7 00000000

[13:50:31] [debug] ESP+00000160: 00000000 08158bb9 f7591592 08158b66

[13:50:31] [debug] ESP+00000180: 00000005 0856bdf0 00001000 f75db000

[13:50:31] [debug] ESP+000001a0: 08158b66 08158b58 00000065 08158bb9

[13:50:31] [debug] ESP+000001c0: f7459726 f608ded8 0809b7a1 08158b66

[13:50:31] [debug] ESP+000001e0: 04000000 fff9b3e0 05000000 fff9b400

[13:50:31] [debug] ESP+00000200: 00000000 03260504 085b0020 000000fa

[13:50:31] [debug] ESP+00000220: 00000001 f608e2c0 00023a71 000004f1

[13:50:31] [debug] ESP+00000240: 66667b26 30303030 52415b7d 5a5f5d57

[13:50:31] [debug] ESP+00000260: 30303066 05297d30 69676f4c 7551046e

[13:50:31] [debug] ESP+00000280: 7ef948f9 d5717ef9 4ef94415 96f6caab

[13:50:31] [debug] ESP+000002a0: 6a9d77b2 7ca3d639 8f94efa7 e797ef97

[13:50:31] [debug] ESP+000002c0: 1ae5063e 9d19fbfb d87df508 4b73a6ea

[13:50:31] [debug] ESP+000002e0: 00001000 f75db420 f74a1510 f7757000

[13:50:31] [debug] ESP+00000300: 00000096 f608e2c0 080964e5 081cb620

[13:50:31] [debug] ESP+00000320: 000000fa fff9b5e8 0809be5b 085b0020

[13:50:31] [debug] ESP+00000340: 081cb620 00000000 00000000 00000096

[13:50:31] [debug] ESP+00000360: 085b0020 fff9b618 080950e4 085b0020

[13:50:31] [debug] ESP+00000380: 00000000 0809be20 f742dff4 085b0020

[13:50:31] [debug] ESP+000003a0: 00000017 fff9b80c f608c74c 0005eadc

[13:50:31] [debug] ESP+000003c0: 39363730 31663765 64303937 34396662

[13:50:31] [debug] ESP+000003e0: 472f7365 79676e61 72625a2f 2f656e61

[13:50:31] [debug] Loaded modules:

[13:50:31] [debug] 00000000 - 00187dc3 6925svr

[13:50:31] [debug] f7769000 - f7769e96 linux-gate.so.1

[13:50:31] [debug] f7751000 - f775381b /lib/i386-linux-gnu/i686/cmov/libdl.so.2

[13:50:31] [debug] f7735000 - f774fd2b /lib/i386-linux-gnu/i686/cmov/libpthread.so.0

[13:50:31] [debug] f7642000 - f773bcda /usr/lib/i386-linux-gnu/libstdc++.so.6

[13:50:31] [debug] f75fc000 - f7640b43 /lib/i386-linux-gnu/i686/cmov/libm.so.6

[13:50:31] [debug] f75df000 - f75fb3c4 /lib/i386-linux-gnu/libgcc_s.so.1

[13:50:31] [debug] f7432000 - f75e722f /lib/i386-linux-gnu/i686/cmov/libc.so.6

[13:50:31] [debug] f776c000 - f778cd6c /lib/ld-linux.so.2

[13:50:31] [debug] f73eb000 - f742dac4 plugins/crashdetect.so

[13:50:31] [debug] f7759000 - f77643ef /lib/i386-linux-gnu/i686/cmov/libnss_files.so.2

[13:50:31] [debug] f415f000 - f416397b /lib/i386-linux-gnu/i686/cmov/libnss_dns.so.2

[13:50:31] [debug] f4147000 - f415f2fb /lib/i386-linux-gnu/i686/cmov/libresolv.so.2

 

Když jdu na server tak se se server vždy vypne, mám vlastní gm.

Log, než jdu na server:

[13:46:56] [debug] Run time error 20: "Invalid index parameter (bad entry point)"

[13:46:56] Script[gamemodes/NovyGM.amx]: Run time error 20: "Invalid index parameter (bad entry point)"

[13:46:56] Number of vehicle models: 188

 

Log když jdu na server:

 

Chyby/varování kompilátoru a při běhu:

--

 

Kód:

 

--

 

 

 

Dodatečné poznámky:

--

Link to comment
Share on other sites

17 odpovědí na tuto otázku

Recommended Posts

  • 0

 

if(IsPlayerInAnyVehicle(playerid)) // i
{
new car = GetPlayerVehicleID(playerid);
new str[128];
new str1[128];
new str2[128];
new str3[128];
new Float:VHP;
GetVehicleHealth(GetPlayerVehicleID(playerid),Float:VHP); // i
format(str,128,"~p~Vozidlo ~w~: %s",VehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]); // i
format(str1,128,"~p~Benzin ~w~: %d",Benzin[car]);
format(str2,128,"~p~Stav ~w~: %.1f %%",VHP/10);
format(str3,128,"~p~KM / H ~w~: %d",GetVehicleSpeed(playerid,true)); // i
TextDrawSetString(Textdraw0,str);
TextDrawSetString(Textdraw1,str1);
TextDrawSetString(Textdraw2,str2);
TextDrawSetString(Textdraw3,str3);

}

Už je to vyřešené, ale mám další problém s tachometrem, když nastoupím do auta, všechno je dobrý, ale když někdo nastoupí jinej, tak se mu ukáže: Název: Moje auta, a KM/H kolik jezdím benzín, prostě vše. Kod:

Link to comment
Share on other sites

  • 0
  • Globální moderátor

namísto GetPlayerVehicleSeat(playerid) == 1

dej GetPlayerVehicleSeat(playerid) == 0

 

koukni se aspoň na tu wiki co ti poslal, tam by jsi to hned pochopil.

Link to comment
Share on other sites

  • 0

Ja tu spis vidim problem v tom ze ma nastaveny jeden textdraw ktery zobrazuje vsem hracum. Spravne by mel mit kazdy hrac svuj textdraw pro zobrazovani udaju aby si to navzajem "nekradli"

//v OnGameModeInit

for(new i;i<MAX_PLAYERS;i++)
{
	Textdraw0[i] = CreateTextDraw(...
	//a sem to das
}

if(IsPlayerInAnyVehicle(playerid))
{
	new str[128],Float:hp,vehicleid = GetPlayerVehicleID(playerid);
	GetVehicleHealth(vehicleid,hp);
	format(str,sizeof(str),"~p~Vozidlo ~w~: %s",VehName[GetVehicleModel(vehicleid)-400]);
	TextDrawSetString(Textdraw0[playerid],str);
	format(str,sizeof(str),"~p~Benzin ~w~: %d",Benzin[vehicleid]);
	TextDrawSetString(Textdraw1[playerid],str);
	format(str,sizeof(str),"~p~Stav ~w~: %.1f %%",hp/10.0);
	TextDrawSetString(Textdraw2[playerid],str);
	format(str,sizeof(str),"~p~KM / H ~w~: %d",GetVehicleSpeed(playerid,true));
	TextDrawSetString(Textdraw3[playerid],str);
}
Edited by ATomas
Link to comment
Share on other sites

  • 0

 

C:\Users\Pepa\Desktop\NovyGM.pwn(4153) : error 028: invalid subscript (not an array or too many subscripts): "Textdraw0"
C:\Users\Pepa\Desktop\NovyGM.pwn(4153) : warning 215: expression has no effect
C:\Users\Pepa\Desktop\NovyGM.pwn(4153) : error 001: expected token: ";", but found "]"
C:\Users\Pepa\Desktop\NovyGM.pwn(4153) : error 029: invalid expression, assumed zero
C:\Users\Pepa\Desktop\NovyGM.pwn(4153) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Kod:

Textdraw0 = TextDrawCreate(479.000000, 298.000000, "Vozidlo:");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
TextDrawColor(Textdraw0, 16711935);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);

TextDrawSetSelectable(Textdraw0, 0);

Když to tam přidám, v on gamemode, neni to celý kod, na ostatnich textdrawec  to ještě nemám
Píše error:


Už to mám, ale je problém v tom, že když nastoupím do auta, tak se ukazuje pouze KM/H a hlavně, to ukazuje v levo úplně nahoře, zkoušel jsem měnit pozice, ale nic.


Už to mám, ale je problém v tom, že když nastoupím do auta, tak se ukazuje pouze KM/H a hlavně, to ukazuje v levo úplně nahoře, zkoušel jsem měnit pozice, ale nic.

Link to comment
Share on other sites

  • 0

Čo ti poradil Atomas je síce pekné, ale takmer zbytočné, nakoľko zmena textu v TD sa prejavuje až po jeho opätovnom prekreslení/zobrazení.

 

Pošli sem ešte raz celý kód a snáď ti poradím..

 

PS: spravi si to tak ako si to mal na začiatku, následne pridaj && GetPlayerVehicleSeat(playerid) == 0) a potom ešte TextDrawShowForPlayer - potom to skús a ak to nepojde, postni celý kod

Link to comment
Share on other sites

  • 0

Mám to tam vložene od atomase, již tak posílám kod..

 

ForMaxPlayer(i)
{
Textdraw0 = TextDrawCreate(479.000000, 298.000000, "Vozidlo:");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
TextDrawColor(Textdraw0, 16711935);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);
TextDrawSetSelectable(Textdraw0, 0);

Textdraw1 = TextDrawCreate(536.000000, 241.000000, "Palivo");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 1);
TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
TextDrawColor(Textdraw1, 16777215);
TextDrawSetOutline(Textdraw1, 0);
TextDrawSetProportional(Textdraw1, 1);
TextDrawSetShadow(Textdraw1, 1);
TextDrawSetSelectable(Textdraw1, 0);

Textdraw2 = TextDrawCreate(536.000000, 250.000000, "Stav");
TextDrawBackgroundColor(Textdraw2, 255);
TextDrawFont(Textdraw2, 1);
TextDrawLetterSize(Textdraw2, 0.500000, 1.000000);
TextDrawColor(Textdraw2, -65281);
TextDrawSetOutline(Textdraw2, 0);
TextDrawSetProportional(Textdraw2, 1);
TextDrawSetShadow(Textdraw2, 1);
TextDrawSetSelectable(Textdraw2, 0);

Textdraw3 = TextDrawCreate(536.000000, 231.000000, "KM/H");
TextDrawBackgroundColor(Textdraw3, 255);
TextDrawFont(Textdraw3, 1);
TextDrawLetterSize(Textdraw3, 0.500000, 1.000000);
TextDrawColor(Textdraw3, 65535);
TextDrawSetOutline(Textdraw3, 0);
TextDrawSetProportional(Textdraw3, 1);
TextDrawSetShadow(Textdraw3, 1);
TextDrawSetSelectable(Textdraw3, 0);
}

if(IsPlayerInAnyVehicle(playerid))
{
new str[128],Float:hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,hp);
format(str,sizeof(str),"~p~Vozidlo ~w~: %s",VehName[GetVehicleModel(vehicleid)-400]);
TextDrawSetString(Textdraw0[playerid],str);
format(str,sizeof(str),"~p~Benzin ~w~: %d",Benzin[vehicleid]);
TextDrawSetString(Textdraw1[playerid],str);
format(str,sizeof(str),"~p~Stav ~w~: %.1f %%",hp/10.0);
TextDrawSetString(Textdraw2[playerid],str);
format(str,sizeof(str),"~p~KM / H ~w~: %d",GetVehicleSpeed(playerid,true));
TextDrawSetString(Textdraw3[playerid],str);
}

 

Link to comment
Share on other sites

  • 0

No, v kóde chybu nevidím... každopádne kedy používaš ForMaxPlayer? Čo všetko máš pred if(IsPlayerInAnyVehicle(playerid)) ? Ako sa to teraz chová?

Link to comment
Share on other sites

  • 0

Čo ti poradil Atomas je síce pekné, ale takmer zbytočné, nakoľko zmena textu v TD sa prejavuje až po jeho opätovnom prekreslení/zobrazení.

 

Pošli sem ešte raz celý kód a snáď ti poradím..

 

PS: spravi si to tak ako si to mal na začiatku, následne pridaj && GetPlayerVehicleSeat(playerid) == 0) a potom ešte TextDrawShowForPlayer - potom to skús a ak to nepojde, postni celý kod

TextDrawSetString aplikuje zmeni i bez prekresleni (hidnuti a shownuti). Proto je potreba aby pro kazdeho hrace byl samostatny textdraw

Link to comment
Share on other sites

  • 0

Public sc kod: 

 

 

forward sc(playerid);
public sc(playerid)
{
new b[100];
format(b,100,"RP: %d",PlayerInfo[playerid][RP]);
TextDrawSetString(Textdraw111,B);
if(IsPlayerInAnyVehicle(playerid))
{
new VehID = GetPlayerVehicleID(playerid);
GetVehiclePos(VehID, VehiclePosX[VehID], VehiclePosY[VehID], VehiclePosZ[VehID]);
}
/*ForMaxPlayer(i)
if(PlayerInfo[Minut] >= 60)
{
PlayerInfo[playerid][Minut] = 0;
PlayerInfo[playerid][Hodin] += 1;
return 1;
}
*/
GetPlayerPos(playerid, Player_Pos[0][playerid] ,Player_Pos[1][playerid] ,Player_Pos[2][playerid]);
if(PortCas[playerid] > 0) PortCas[playerid] --;
if(LokacCas[playerid] > 0) PortCas[playerid] --;
ForMaxPlayer(i)
SetPlayerScore(i, GetPlayerMoney(i));
//GetPlayerPos(playerid, PlayerInfo[playerid][Xx],PlayerInfo[playerid][Yy], PlayerInfo[playerid][Zz]);
//ForMaxPlayer(i)
//{
if(IsPlayerInAnyVehicle(playerid))
{
new str[128],Float:hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,hp);
format(str,sizeof(str),"~p~Vozidlo ~w~: %s",VehName[GetVehicleModel(vehicleid)-400]);
TextDrawSetString(Textdraw0[playerid],str);
format(str,sizeof(str),"~p~Benzin ~w~: %d",Benzin[vehicleid]);
TextDrawSetString(Textdraw1[playerid],str);
format(str,sizeof(str),"~p~Stav ~w~: %.1f %%",hp/10.0);
TextDrawSetString(Textdraw2[playerid],str);
format(str,sizeof(str),"~p~KM / H ~w~: %d",GetVehicleSpeed(playerid,true));
TextDrawSetString(Textdraw3[playerid],str);
}
return 1;
}

 

Link to comment
Share on other sites

  • 0

1) Neviem odkiaľ public SC berie playerid? Pokiaľ ho nikde neudávaš, automaticky je vždy 0, takže to bude fungovať len pre ID 0

2) Nenapísal si, ako sa to chová teraz, čo máme riešiť?

Link to comment
Share on other sites

  • 0

No furt, je to úplně stejné, tachometr, není vidět jenom KM/H a hlavně, v levo nahoře.

Hod sem cely kod, jinak to budes opravovat do vanoc.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...