server crashing randomly and when spawning cars
#1

hello all im making my own game mode and so for testing i made a car spawn code. my gamemode used to work correctly but apparently not now.

i changed my vps plan and my machine from where i get it (doesnt really matter i think)
i installed same stuff as normal its working while normally in game but when i spawn a car i lose connection to server and i see server is crashed. i installed crashdetect so see what is the problem but heres the funny line.
Код:
Server crashed while executing gm.amx
[13:14:19] [debug] AMX backtrace:
[13:14:19] [debug] #0 ffffffff in public Iter_OnFilterScriptInit () from gm.amx
i neither have any iter in my gamemore nor a public onfilterscriptinit. i dont even have any filterscript in my server.cfg file.

code that crashes:
Код:
CMD:createv(playerid,params[])
{
	new vehid,Float:xx,Float:yy,Float:zz;
	if(sscanf(params,"i",vehid)) return 0;
	GetPlayerPos(playerid,xx,yy,zz);
	new vid = CreateVehicle(vehid,xx,yy,zz,0,0,0,-1);
	vInfo[vid][vFuel]=88;
	return 1;
}
anybody has any idea?

PS: I couldnt get the game to crash randomly so i dont know what causes random crashes too yet.
Reply
#2

Your crash info doesn't really tell us much. Are you using the PAWNO compiler? If so, set the debug level to 3, re-compile the script, re-create the crash and then show us the log.

To set the debug level to 3, insert a text file called pawn.cfg inside your pawno folder, insert -d3, then save.
Reply
#3

my compiler says
Код:
Header size:           9472 bytes
Code size:           510512 bytes
Data size:          1836592 bytes
Stack/heap size:      16384 bytes; estimated max. usage=1815 cells (7260 bytes)
Total requirements: 2372960 bytes

8 Warnings.
and again my serverlog writes
Код:
[13:48:30] [debug] Server crashed while executing gm.amx
[13:48:30] [debug] AMX backtrace:
[13:48:30] [debug] #0 ffffffff in public Iter_OnFilterScriptInit () at <unknown file>:0
idk why second one changed to unkownfile i changed my foreach file
Reply
#4

What are the warnings?

Do you have any filterscripts in your server.cfg?
Reply
#5

Iter_OnFilterScriptInit() is a piece of foreach.inc(0.41 or something it must be latest). no i dont have any filterscripts in my server.cfg as i said. i also realised when i do getvehicle from saved vehicles they spawn far so they dont crash game but when i get in range to see it game crashes. and says the same. so vehiles crash the server when someones field of view sees the vehicle.

EDIT:
Код:
C:\Users\PC\Desktop\samp\pawno\include\zcmd.inc(96) : warning 217: loose indentation
C:\Users\PC\Desktop\samp\pawno\include\zcmd.inc(97) : warning 217: loose indentation
C:\Users\PC\Desktop\samp\pawno\include\zcmd.inc(98) : warning 217: loose indentation
C:\Users\PC\Desktop\samp\pawno\include\YSI\y_stringhash.inc(1679) : warning 219: local variable "hash" shadows a variable at a preceding level
C:\Users\PC\Desktop\samp\pawno\include\YSI\y_stringhash.inc(1705) : warning 219: local variable "hash" shadows a variable at a preceding level
C:\Users\PC\Desktop\samp\pawno\include\YSI\y_stringhash.inc(1731) : warning 219: local variable "hash" shadows a variable at a preceding level
C:\Users\PC\Desktop\samp\gamemodes\gm.pwn(6667) : warning 203: symbol is never used: "carradio"
C:\Users\PC\Desktop\samp\gamemodes\gm.pwn(6667) : warning 203: symbol is never used: "ret_memcpy"
these warnings mean nothing because i know being able to run the gm before with these and even more warnings.

sorry about forgetting to add these after you ask
Reply
#6

What are the warnings in your compiler?
Reply
#7

they are added

Код:
C:\Users\PC\Desktop\samp\pawno\include\zcmd.inc(96) : warning 217: loose indentation
C:\Users\PC\Desktop\samp\pawno\include\zcmd.inc(97) : warning 217: loose indentation
C:\Users\PC\Desktop\samp\pawno\include\zcmd.inc(98) : warning 217: loose indentation
C:\Users\PC\Desktop\samp\pawno\include\YSI\y_stringhash.inc(1679) : warning 219: local variable "hash" shadows a variable at a preceding level
C:\Users\PC\Desktop\samp\pawno\include\YSI\y_stringhash.inc(1705) : warning 219: local variable "hash" shadows a variable at a preceding level
C:\Users\PC\Desktop\samp\pawno\include\YSI\y_stringhash.inc(1731) : warning 219: local variable "hash" shadows a variable at a preceding level
C:\Users\PC\Desktop\samp\gamemodes\gm.pwn(6667) : warning 203: symbol is never used: "carradio"
C:\Users\PC\Desktop\samp\gamemodes\gm.pwn(6667) : warning 203: symbol is never used: "ret_memcpy"
Reply
#8

And the vehicle command crashes your server before it creates them?
Reply
#9

Код:
CMD:createv(playerid,params[])
{
	new vehid,Float:xx,Float:yy,Float:zz;
	if(sscanf(params,"i",vehid)) return 0;
	GetPlayerPos(playerid,xx,yy,zz);
	new vid = CreateVehicle(vehid,xx,yy,zz,0,0,0,-1);
	vInfo[vid][vFuel]=88;
	return 1;
}
also this spawn saved cars

Код:
CMD:vget(playerid, params[])
{
    new keys;
	new query[500];
	mysql_format(mysql,query,sizeof(query),"SELECT * FROM vehicles WHERE vOwner='%s'",GetName(playerid));
	mysql_query(mysql,query);
	keys=cache_get_row_count();
    new modelid1,modelid2,modelid3;
    modelid1=cache_get_field_content_int(0,"vModel");
    modelid2=cache_get_field_content_int(1,"vModel");
    modelid3=cache_get_field_content_int(2,"vModel");
    new string[512];
    if(keys==0) return SCM(playerid,COLOR_RED,"You don't own any vehicle.");
    if(keys==1)
    {
        format(string, sizeof(string), "%s%d\n%d\n", string, modelid1, modelid1);
    }
    if(keys==2)
    {
		format(string, sizeof (string), "%s%d\n%d\n", string, modelid1, modelid1);
		format(string, sizeof (string), "%s%d\n%d\n", string, modelid2, modelid2);
    }
    if(keys==3)
    {
        format(string, sizeof (string), "%s%d\n%d\n", string, modelid1, modelid1);
        format(string, sizeof (string), "%s%d\n%d\n", string, modelid2, modelid2);
        format(string, sizeof (string), "%s%d\n%d\n", string, modelid3, modelid3);
    }
    ShowPlayerDialog(playerid, 6969, DIALOG_STYLE_PREVMODEL, "Vehicle's list", string, "Spawn", "Close");
    return 1;
}
saved cars crashed the server too but as they spawn far they dont crash directly. they only crash when you get close to them so they appear on your screen

createv command crashes directly not being even able to see the vehicle.

when i spawned a saved car i couldnt get close(because when you walk towards it it crashes again) but it was spawned and it was marked on minimap. so to see it spawned i used tp command and tped right on to it. I stood on it not even half second and server crash
Reply
#10

tried removing the foreach.inc and changing foreaches in my gm to for(variables) it worked for only 5 second. i spwaned the vehicle entered the vehicle then lost connection and server crash.

this time it says
Код:
[14:52:26] [debug] Server crashed while executing gm.amx
[14:52:26] [debug] AMX backtrace:
[14:52:26] [debug] #0 ffffffff in public OnEnterExitModShop () at <unknown file>:0
what kind of a stupid thing is this? do i have to remove all my includes and return back to bare gm?
Reply


Forum Jump:


Users browsing this thread: