SA-MP Forums Archive
0 Errors but gamemode blocks itself - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: 0 Errors but gamemode blocks itself (/showthread.php?tid=574585)



0 Errors but gamemode blocks itself - Steveproxy5 - 18.05.2015

My gamemode crashes after a few minutes, I mean, you can't type any message or command, and all functions are disabled, but there is no error about pawn compiler. Please I need help, seriously , can you tell me how to do? What do you think about this one?


Re: 0 Errors but gamemode blocks itself - MP2 - 18.05.2015

Possibly an infinite loop. Do you have any while() loops?


Re: 0 Errors but gamemode blocks itself - Steveproxy5 - 18.05.2015

No I don't, why happens this? :l


Re: 0 Errors but gamemode blocks itself - Dokins - 18.05.2015

Do you have any loops at all?

search

for(new


Re: 0 Errors but gamemode blocks itself - Steveproxy5 - 18.05.2015

I have a lot of cicle named for(new [...]
but when pawn compiles there is no error about anything


Re: 0 Errors but gamemode blocks itself - SoFahim - 18.05.2015

Is your server freeze or just crashed?


Re: 0 Errors but gamemode blocks itself - Steveproxy5 - 18.05.2015

No, my server doesn't work any longer after a few minutes that's I can't type any command or message and I can't know why


Re: 0 Errors but gamemode blocks itself - Vince - 18.05.2015

Quote:
Originally Posted by Steveproxy5
Посмотреть сообщение
I have a lot of cicle named for(new [...]
but when pawn compiles there is no error about anything
The compiler only checks the syntax. It does not account for logical errors. Consider:

pawn Код:
for(new i = 100; i > 0; i++)
{
    printf("%d", i);
}
This will run forever because i is forever greater than 0. The programmer intended to write 'i--', but due to force of habit wrote 'i++'.


Re: 0 Errors but gamemode blocks itself - Steveproxy5 - 18.05.2015

Quote:
Originally Posted by Vince
Посмотреть сообщение
The compiler only checks the syntax. It does not account for logical errors. Consider:

pawn Код:
for(new i = 100; i > 0; i++)
{
    printf("%d", i);
}
This will run forever because i is forever greater than 0. The programmer intended to write 'i--', but due to force of habit wrote 'i++'.
Ok, how can I do then?


Re: 0 Errors but gamemode blocks itself - Dokins - 18.05.2015

I can't see any issues with the Server log. It brings us back to the loops. As MP2 said, there could be an illogical loop causing an infinite loop, this will crash ANY script, your best bet is check any recently added or edited loops and post them here.


Re: 0 Errors but gamemode blocks itself - Steveproxy5 - 18.05.2015

What do you think about ->
Code:
forward azione(playerid,string[]);
public azione(playerid,string[])//HO DOVUTO METTERE QUESTO PERCHE' NON SO' COM'E' FATTA LA VOSTRA GM
{
    for(new u = 0; u < MAX_PLAYERS; u++)
    {
		if(IsPlayerConnected(u))
		{
        	if( GetDistanceBetweenPlayers(playerid,u) < 30 )
            {
        	    SendClientMessage(u,0xFFFFFFAA,string);
            }
		}
    }
}
forward crescita();
public crescita()
{
	for(new i=0;i<MAX_PLAYERS;i++)
    {
    	if(IsPlayerConnected(i))
        {
            if( StatoPianta[i] >= 1 )
            {
                StatoPianta[i] += 1;
                if( StatoPianta[i] < 20 )
                {
                	new Float:lX,Float:lY,Float:lZ;
                    GetObjectPos(Pianta[i],lX,lY,lZ);
                    MoveObject(Pianta[i],lX,lY,lZ+0.05,2.0);
                }
            }
		}
	}
}

case 3:
   			  {
   			    	if(IsPlayerConnected(playerid))
        			{
            			if(gPlayerLogged[playerid] == 0)
            			{
                			SendClientMessage(playerid, 0xFF0000AA, "Devi effettura prima il login");
                			return 1;
            			}
               for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
                        {
                        if(IsPlayerAttachedObjectSlotUsed(playerid, i)==0) {
			            SetPlayerAttachedObject(playerid, 1, 3026, 1, -0.125, -0.046, -0.004, -1.299, -0.5, -6.297, 1.0, 1.0, 1.0);
			            }
			            else {
			            RemovePlayerAttachedObject(playerid, i);
			            }

                       }
					}
				}



Re: 0 Errors but gamemode blocks itself - Steveproxy5 - 18.05.2015

I'm becoming mad, I can't solve this problem, what may I do?


Re: 0 Errors but gamemode blocks itself - Steveproxy5 - 18.05.2015

I'm trying to replace all 'i' with 'playerid'


Re: 0 Errors but gamemode blocks itself - Steveproxy5 - 18.05.2015

help me please i'm desperate i don't know anymore what to do


Re: 0 Errors but gamemode blocks itself - Jefff - 19.05.2015

pawn Code:
sscanf error: The current build ONLY supports 0.3d

Loading plugin: MapAndreas.dll
Failed.

EnableTirePopping() function is removed.

[warning] EnableZoneNames() is removed since 0.3

AllowAdminTeleport() : function is deprecated. Please see OnPlayerClickMap()
and you surprised that the server dies... in my opinion its from MapAndreas, you are using some functions from this plugin but he's not loaded so result could be one and sscanf error is also important

+

install crashdetect plugin and you will see what's exactly wrong


Re: 0 Errors but gamemode blocks itself - amirm3hdi - 19.05.2015

Undo last changes you did, or delete functions till your GM works, then you'll know which part is wrong...


Re: 0 Errors but gamemode blocks itself - Toxik - 19.05.2015

Codes removed
pawn Code:
EnableTirePopping() function is removed. //removed

[warning] EnableZoneNames() is removed since 0.3 //removed

AllowAdminTeleport() : function is deprecated. Please see OnPlayerClickMap() //Function need to be fixed
and try download new verison of sscanf and MapAndreas.inc % MapAndreas.dll Plugin hope you fix it


Re: 0 Errors but gamemode blocks itself - Steveproxy5 - 19.05.2015

I tried to download sscanf and streamer but there was no positive effect. Is stramer.dl same of mapandreas? I cant find this one


Re: 0 Errors but gamemode blocks itself - SoFahim - 19.05.2015

Quote:
Originally Posted by Steveproxy5
Посмотреть сообщение
No, my server doesn't work any longer after a few minutes that's I can't type any command or message and I can't know why
That mean your server freeze . If you using YSI3.1 then your problem would not be fix. Try to use YSI4.0 . It will help you to fix that. If you get for then 2+warning of Foreach loop , that mean you didn't update the loop of the foreach.

Old code is
PHP код:
foreach(player,i
new code is
PHP код:
foreach(new iplayer
If it don't help you then please -rep


Re: 0 Errors but gamemode blocks itself - Steveproxy5 - 19.05.2015

So do i have to replace ones each other?