SA-MP Forums Archive
this code crashes server ( segmentation fault) - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: this code crashes server ( segmentation fault) (/showthread.php?tid=207545)



this code crashes server ( segmentation fault) - armyoftwo - 06.01.2011

This code crashes the server, but it didnt crash before!!
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(VehicleInfo[vehicleid][Owned] == 1) {
        new PlayerName[24];
        GetPlayerName(playerid, PlayerName, 24);
        if(strcmp(VehicleInfo[vehicleid][vOwner], PlayerName, true ) != 0 && ispassenger == 0) {
            SendClientMessage(playerid, COLOR_LIGHTRED, LoadText(playerid, "NOT_OWN"));
            SendClientMessage(playerid, COLOR_LIGHTRED, LoadText(playerid, "NOT_OWN2"));
            ClearAnimations(playerid);
            return 1;
        }
    }
    return 1;
}



Re: this code crashes server ( segmentation fault) - _rAped - 06.01.2011

I have had a lot of bad experiences with global variables, check if they are set correctly.


Re: this code crashes server ( segmentation fault) - armyoftwo - 06.01.2011

Fixed, i forgot to format the message