Can anyone help me out here?
#1

Does anyone see anything wrong with the codes i typed here, when i /acceptdeath in my server the server crashes.


Код:
    		else if(PlayerDied[playerid] == 1) {

			SetPlayerPos(playerid, deadx[playerid], deady[playerid], deadz[playerid]);
			SetPlayerInterior(playerid, DeadInt[playerid]);
			SetPlayerVirtualWorld(playerid, DeadWorld[playerid]);
			SetPlayerCameraPos(playerid, deadx[playerid], deady[playerid], deadz[playerid]+5);
			SetPlayerCameraLookAt(playerid, deadx[playerid], deady[playerid], deadz[playerid]);
			TogglePlayerControllable(playerid, 0);
			SetTimerEx("FallPlayer", 100, 0, "d", playerid);
		    SetPlayerDrunkLevel(playerid, 3000);
			SendClientMessage(playerid, COLOR_LIGHTRED, "You were wounded if a medic or anyone else doesn't save you,you will die.");
			SendClientMessage(playerid, COLOR_LIGHTRED, "To accept death type /acceptdeath.");
			pUncountious[playerid] = 1;
			gPlayerUsingLoopingAnim[playerid] = 1;
			dying[playerid] = 1;
			Usinganim[playerid] = 1;
			return 1;
		}
	else
    {


Код:
if(strcmp(cmd, "/acceptdeath", true) == 0)
	{
    	if(dying[playerid] == 1) {

        Hospitalizeds[playerid] = 0;
        dying[playerid] = 0;
        pUncountious[playerid] = 0;
        TogglePlayerControllable(playerid, 1);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerColor(playerid,TEAM_HIT_COLOR);
        TogglePlayerControllable(playerid,1);
        new rand;
        rand = random(sizeof(gRandomHospitalSpawns));
        DOO_SetPlayerPos(playerid, gRandomHospitalSpawns[rand][0], gRandomHospitalSpawns[rand][1], gRandomHospitalSpawns[rand][2]); // Warp the player
        SetPlayerFacingAngle(playerid, 270.0);
        FadePlayerScreen(playerid,COLOR_BLACK, 40);
        SetCameraBehindPlayer(playerid);
        OnePlayAnim(playerid,"INT_HOUSE","LOU_Out",4.0,0,0,0,0,0);
        SendClientMessage(playerid, COLOR_LIGHTRED, "You have been release from the hospital.");
        SendClientMessage(playerid, COLOR_LIGHTRED, "((Remember you lost 30 minutes of memory.))");
		SetPlayerDrunkLevel(playerid, 0);
        SetPlayerHealth(playerid, 30.0);
        Hospitalizeds[playerid] = 0;
        //Usinganim[playerid] = 0;
        PlayerInfo[playerid][pInvWeapon] = 0;
        PlayerInfo[playerid][pInvAmmo] = 0;
        ResetPlayerWeaponsEx(playerid);

    	}
		return 1;
	}


Im really stuck on it, ill reputation you if you get it right
Reply
#2

Use print on each line and see where it crashes.
Reply
#3

Im so sorry but how do i do that? im a new scripter :\
Reply
#4

https://sampwiki.blast.hk/wiki/Print

If you're new, I suggest to read the PAWN documentation and the wiki
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)