SA-MP Forums Archive
CrashDetect.so - 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: CrashDetect.so (/showthread.php?tid=493652)



CrashDetect.so - Mahde - 09.02.2014

Code:
[13:01:29]+ [debug] Run time error 4: "Array index out of bounds"
[13:01:29]+ [debug]  Accessing element at index 65535 past array upper bound 499
[13:01:29]+ [debug] AMX backtrace:
[13:01:29]+ [debug] #0 0004ee60 in public cmd_go (playerid=19, params[]=@0x010d2244 "21") at C:\Users\MaHdy\Desktop\SPA Server original\filterscripts\JLadmin.pwn:5079
[13:01:29]+ [debug] #1 native CallLocalFunction () [080d2bb0] from samp03svr
[13:01:29]+ [debug] #2 0001b3a4 in ?? (... <2 arguments>) at C:\Users\MaHdy\Desktop\SPA Server original\pawno\include\zcmd.inc:111
[13:01:29]+ [debug] #3 00006d6c in public OnPlayerCommandText (playerid=19, cmdtext[]=@0x010d2228 "/go 21") at C:\Users\MaHdy\Desktop\SPA Server original\pawno\include\YSI\y_hooks/impl.inc:929
[13:01:29]+ [chat] [CraL]: veysel
[13:01:30]+ [chat] [CraL]: nerdesin
[13:01:35]+ [debug] Run time error 4: "Array index out of bounds"
[13:01:35]+ [debug]  Accessing element at index 65535 past array upper bound 499
[13:01:35]+ [debug] AMX backtrace:
[13:01:35]+ [debug] #0 0004ee60 in public cmd_go (playerid=19, params[]=@0x010d2244 "21") at C:\Users\MaHdy\Desktop\SPA Server original\filterscripts\JLadmin.pwn:5079
[13:01:35]+ [debug] #1 native CallLocalFunction () [080d2bb0] from samp03svr
[13:01:35]+ [debug] #2 0001b3a4 in ?? (... <2 arguments>) at C:\Users\MaHdy\Desktop\SPA Server original\pawno\include\zcmd.inc:111
[13:01:35]+ [debug] #3 00006d6c in public OnPlayerCommandText (playerid=19, cmdtext[]=@0x010d2228 "/go 21") at C:\Users\MaHdy\Desktop\SPA Server original\pawno\include\YSI\y_hooks/impl.inc:929
Go Command
Code:
CMD:go(playerid, params[])
{
    new id,Float:Pos[3];
    if(sscanf(params, "u", id)) return GameTextForPlayer(playerid,"~B~/Go ~R~<player ID>~N~~N~~N~~w~/gon ~g~Enable ~W~GOTO~N~/goff ~R~Disable ~W~GOTO",2000,3);
    if(GotoDisabled[id] == 1)
    {
        GameTextForPlayer(playerid,"~b~Player ~R~Disabled ~B~Goto",2000,3);
        return 1;
    }
    if(IsPlayerConnected(id) && id != playerid)
    {
	         GetPlayerPos(id,Pos[0],Pos[1],Pos[2]);
			 SetPlayerInterior(playerid,GetPlayerInterior(id));
			 //SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
			 if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			 {
			    SetVehiclePos(GetPlayerVehicleID(playerid),Pos[0]+3,Pos[1],Pos[2]);
				LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(id));
				//SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(id));
		     }
		     else SetPlayerPos(playerid,Pos[0]+3,Pos[1],Pos[2]);
		     format(Jstring,sizeof(Jstring),"You have been Teleported to '%s'", GetName(id));
		     SendClientMessage(playerid,yellow,Jstring);
			 return 1;
	   }
	   else return ShowMessage(playerid, red, 3);
}



Re: CrashDetect.so - Konstantinos - 09.02.2014

Change to:
pawn Code:
CMD:go(playerid, params[])
{
    new id,Float:Pos[3];
    if(sscanf(params, "u", id)) return GameTextForPlayer(playerid,"~B~/Go ~R~<player ID>~N~~N~~N~~w~/gon ~g~Enable ~W~GOTO~N~/goff ~R~Disable ~W~GOTO",2000,3);
    if(IsPlayerConnected(id) && id != playerid)
    {
        if(GotoDisabled[id] == 1)
        {
            GameTextForPlayer(playerid,"~b~Player ~R~Disabled ~B~Goto",2000,3);
            return 1;
        }
        GetPlayerPos(id,Pos[0],Pos[1],Pos[2]);
        SetPlayerInterior(playerid,GetPlayerInterior(id));
        //SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            SetVehiclePos(GetPlayerVehicleID(playerid),Pos[0]+3,Pos[1],Pos[2]);
            LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(id));
            //SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(id));
        }
        else SetPlayerPos(playerid,Pos[0]+3,Pos[1],Pos[2]);
        format(Jstring,sizeof(Jstring),"You have been Teleported to '%s'", GetName(id));
        SendClientMessage(playerid,yellow,Jstring);
        return 1;
    }
    else return ShowMessage(playerid, red, 3);
}



Re: CrashDetect.so - Mahde - 09.02.2014

Quote:
Originally Posted by Konstantinos
View Post
Change to:
pawn Code:
CMD:go(playerid, params[])
{
    new id,Float:Pos[3];
    if(sscanf(params, "u", id)) return GameTextForPlayer(playerid,"~B~/Go ~R~<player ID>~N~~N~~N~~w~/gon ~g~Enable ~W~GOTO~N~/goff ~R~Disable ~W~GOTO",2000,3);
    if(IsPlayerConnected(id) && id != playerid)
    {
        if(GotoDisabled[id] == 1)
        {
            GameTextForPlayer(playerid,"~b~Player ~R~Disabled ~B~Goto",2000,3);
            return 1;
        }
        GetPlayerPos(id,Pos[0],Pos[1],Pos[2]);
        SetPlayerInterior(playerid,GetPlayerInterior(id));
        //SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            SetVehiclePos(GetPlayerVehicleID(playerid),Pos[0]+3,Pos[1],Pos[2]);
            LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(id));
            //SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(id));
        }
        else SetPlayerPos(playerid,Pos[0]+3,Pos[1],Pos[2]);
        format(Jstring,sizeof(Jstring),"You have been Teleported to '%s'", GetName(id));
        SendClientMessage(playerid,yellow,Jstring);
        return 1;
    }
    else return ShowMessage(playerid, red, 3);
}
YOU ARE THE BEST IN SAMP FORUMS !!!!!!!!!!!!! bro can u told me how to destroyvehicle when player death if he was driving? (LEADER)