0Admin system help:
#1

Hello!

I have a big problem with the command /get ingame. Let me explain:

If i am going to /get, and the player is in a vehicle, the command totally fails. Instead of "getting" the person to your location, it teleports the player to a farm, under the ground, and the player is falling in the void.

I have checked my script, and i havent touched it:

Код:
CMD:get(PARAMS)
{
    LoginCheck(playerid);
    LevelCheck(playerid, 3);

	new Player;
    if(sscanf(params, "u", Player)) return SendUsage(playerid, "/get "GREY"<id>", "Will teleport the specified player to your position");
	else
	{
	    if(Player == (0xFFFF))  return SendError(playerid, "Player not connected!");
	    if(Player == playerid )  return SendError(playerid, "Player entered is you!");
        CheckImune(playerid, Player);{}

	    new Float: Pos[4];

	    if(IsPlayerInAnyVehicle(Player))

		{
	        LinkVehicleToInterior(GetPlayerVehicleID(Player), GetPlayerInterior(playerid));
			SetVehicleVirtualWorld(GetPlayerVehicleID(Player), GetPlayerVirtualWorld(playerid));

			SetVehiclePos(GetPlayerVehicleID(Player), Pos[0] + 2, Pos[1] + 2, Pos[2] + 2);
			SetVehicleZAngle(GetPlayerVehicleID(Player), Pos[3]);
	    }
	    else
     {
         GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
	    	GetPlayerFacingAngle(playerid, Pos[3]);

	    	SetPlayerPos(Player, Pos[0], Pos[1] + 2, Pos[2] + 1);
	    	SetPlayerFacingAngle(Player, Pos[3]);
	    }
	    SetPlayerVirtualWorld(Player, GetPlayerVirtualWorld(playerid));
	    SetPlayerInterior(Player, GetPlayerInterior(playerid));
	    SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported "ORAN"%s[%i]"GREY" to his location!", Name(playerid), playerid, Name(Player), Player);
	    FormatMSG(playerid, Color:GREY, "You teleported to "ORAN"%s[%i]"GREY" to your location!", Name(Player), Player);
	}
	return 1;
}
And i am wondering, can i fix it?

I dont want the player to go out of vehicle each time i am going to /get them, so.... Thanks!!
Reply
#2

pawn Код:
COMMAND:get(playerid,params[])
{
    LoginCheck(playerid);
    LevelCheck(playerid, 3);

    new Player;
    if(sscanf(params, "u", Player)) return SendUsage(playerid, "/get "GREY"<id>", "Will teleport the specified player to your position");
    else
    {
        if(Player == (0xFFFF))  return SendError(playerid, "Player not connected!");
        if(Player == playerid )  return SendError(playerid, "Player entered is you!");
        CheckImune(playerid, Player);{}

        new Float: Pos[4];

        if(IsPlayerInAnyVehicle(Player))

        {
            LinkVehicleToInterior(GetPlayerVehicleID(Player), GetPlayerInterior(playerid));
            SetVehicleVirtualWorld(GetPlayerVehicleID(Player), GetPlayerVirtualWorld(playerid));

            SetVehiclePos(GetPlayerVehicleID(Player), Pos[0] + 2, Pos[1] + 2, Pos[2] + 2);
            SetVehicleZAngle(GetPlayerVehicleID(Player), Pos[3]);
        }
        else
     {
         GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
            GetPlayerFacingAngle(playerid, Pos[3]);

            SetPlayerPos(Player, Pos[0], Pos[1] + 2, Pos[2] + 1);
            SetPlayerFacingAngle(Player, Pos[3]);
        }
        SetPlayerVirtualWorld(Player, GetPlayerVirtualWorld(playerid));
        SetPlayerInterior(Player, GetPlayerInterior(playerid));
        SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported "ORAN"%s[%i]"GREY" to his location!", Name(playerid), playerid, Name(Player), Player);
        FormatMSG(playerid, Color:GREY, "You teleported to "ORAN"%s[%i]"GREY" to your location!", Name(Player), Player);
    }
    return 1;
}
Replace the whole comand with what I gave you :P
Reply
#3

"0Admin.pwn(4475) : warning 217: loose indentation" (i checked the line; it is for GetPlayerFacingAngle(playerid, Pos[3]).

But it compiled.
Reply
#4

note: 0.0 , 0.0 , 0.0 on the map is just underground a farm in blueberry, this should help you to find the problem in your code.

further note: check https://sampforum.blast.hk/showthread.php?tid=120356 to see if the "u" parameter is working with 3d / 3e.
Reply
#5

Код:
COMMAND:get(playerid,params[])
{
    LoginCheck(playerid);
    LevelCheck(playerid, 3);
    new playerid2, Float:X, Float:Y, Float:Z, Float:A;
    if(sscanf(params, "u", playerid2)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /get [ID]");
	else
    {
        if(!IsPlayerConnected(playerid2)) return SendClientMessage(playerid, COLOR_GREY, "ERROR: There was no player found with this ID.");
        if(playerid2 == playerid) return SendClientMessage(playerid, COLOR_GREY, "ERROR: You can't teleport yourself.");
        CheckImune(playerid, Player);{}
        if(IsPlayerInAnyVehicle(playerid2))
        {
            LinkVehicleToInterior(GetPlayerVehicleID(playerid2), GetPlayerInterior(playerid));
            SetVehicleVirtualWorld(GetPlayerVehicleID(playerid2), GetPlayerVirtualWorld(playerid));
            GetVehicleZAngle(GetPlayerVehicleID(playerid2), A);
            GetVehiclePos(GetPlayerVehicleID(playerid2), X, Y, Z);

            SetVehiclePos(GetPlayerVehicleID(playerid2), X, Y, Z);
            SetVehicleZAngle(GetPlayerVehicleID(playerid2), A);
        }
        else
     	{
            GetPlayerPos(playerid, X, Y, Z);
            GetPlayerFacingAngle(playerid, A);

            SetPlayerPos(playerid2, X, Y, Z);
            SetPlayerFacingAngle(playerid2, A);
        }
        SetPlayerVirtualWorld(playerid2, GetPlayerVirtualWorld(playerid));
        SetPlayerInterior(playerid2, GetPlayerInterior(playerid));
        SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported "ORAN"%s[%i]"GREY" to his location!", Name(playerid), playerid, Name(Player), Player);
        FormatMSG(playerid, Color:GREY, "You teleported to "ORAN"%s[%i]"GREY" to your location!", Name(Player), Player);
    }
    return 1;
}
Reply
#6

Код:
C:\Users\simla190995\Downloads\samp03dsvr_R2_win32\filterscripts\0Admin.pwn(4494) : error 017: undefined symbol "COLOR_GREY"
C:\Users\simla190995\Downloads\samp03dsvr_R2_win32\filterscripts\0Admin.pwn(4497) : error 017: undefined symbol "COLOR_GREY"
C:\Users\simla190995\Downloads\samp03dsvr_R2_win32\filterscripts\0Admin.pwn(4498) : error 017: undefined symbol "COLOR_GREY"
C:\Users\simla190995\Downloads\samp03dsvr_R2_win32\filterscripts\0Admin.pwn(4499) : error 017: undefined symbol "Player"
C:\Users\simla190995\Downloads\samp03dsvr_R2_win32\filterscripts\0Admin.pwn(4520) : error 017: undefined symbol "Player"
C:\Users\simla190995\Downloads\samp03dsvr_R2_win32\filterscripts\0Admin.pwn(4521) : error 017: undefined symbol "Player"
C:\Users\simla190995\Downloads\samp03dsvr_R2_win32\filterscripts\0Admin.pwn(10919) : error 020: invalid symbol name ""
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.
ehm, what have i done now? xD
Reply
#7

Quote:
Originally Posted by airplanesimen
Посмотреть сообщение
Код:
C:\Users\simla190995\Downloads\samp03dsvr_R2_win32\filterscripts\0Admin.pwn(4494) : error 017: undefined symbol "COLOR_GREY"
C:\Users\simla190995\Downloads\samp03dsvr_R2_win32\filterscripts\0Admin.pwn(4497) : error 017: undefined symbol "COLOR_GREY"
C:\Users\simla190995\Downloads\samp03dsvr_R2_win32\filterscripts\0Admin.pwn(4498) : error 017: undefined symbol "COLOR_GREY"
C:\Users\simla190995\Downloads\samp03dsvr_R2_win32\filterscripts\0Admin.pwn(4499) : error 017: undefined symbol "Player"
C:\Users\simla190995\Downloads\samp03dsvr_R2_win32\filterscripts\0Admin.pwn(4520) : error 017: undefined symbol "Player"
C:\Users\simla190995\Downloads\samp03dsvr_R2_win32\filterscripts\0Admin.pwn(4521) : error 017: undefined symbol "Player"
C:\Users\simla190995\Downloads\samp03dsvr_R2_win32\filterscripts\0Admin.pwn(10919) : error 020: invalid symbol name ""
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.
ehm, what have i done now? xD
I could make the Colors work, but now i am tuck in the script with "undefined Symbol ""Player"""
This is one of the lines:
Код:
CheckImune(playerid, Player);{}
This came when i pasted the last code from Shetch. It looks like i have to define it, could you send the define line to me ? (Shetch). Thanks.
Reply
#8

replace the "Player" with "playerid2"
Reply
#9

After updating sscanf into 2.6, i got this error... And i got everything else to work again, thank you so much, but i havent tested it yet

i get this error now, i am sure there is only a ; missing, but i have checked many times. Can maybe you see the error?

Reply
#10

Quote:
Originally Posted by airplanesimen
Посмотреть сообщение
After updating sscanf into 2.6, i got this error... And i got everything else to work again, thank you so much, but i havent tested it yet

i get this error now, i am sure there is only a ; missing, but i have checked many times. Can maybe you see the error?

To be honest i have no idea what the problem is there.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)