Little Help
#1

Hi,

I searched on ****** and forums, but i cant find an topic about this (if you know one just give the link).

This is what i want. (i mean the fence doesen't need to open with an command i mean you just will be teleported to the other side, like Los Santos Prison (LSP) in (LSRP)

Example: there is an gate you type /enter and you and you car will be teleported to the other side of the fence

Current code:

Код:
if(strcmp(cmd, "/enter2", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			if (PlayerInfo[playerid][pAdmin] >= 1337)
            {
            SetPlayerPos(playerid, -1833.2200, -16.1694, 15.1172);// zoek
            new currentveh;
            currentveh = GetPlayerVehicleID(playerid);
            new Float:vehx, Float:vehy, Float:vehz;
            GetVehiclePos(currentveh, vehx, vehy, vehz);
            SetVehiclePos(371, -1833.2200, -16.1694, 15.1172);
            return 1;
			 }
    }
    return 1;
    }
But it has some problems you see
Код:
SetVehiclePos(371, -1833.2200, -16.1694, 15.1172);
i need to define all the vehicle models, so is there a way that you can teleport with every vehicle i dont want to define every vehicle model.

Second when you teleport you will be spawned next to your car is there a way you teleport back in to your car, plus the passengers.
Reply
#2

deleted
Reply
#3

Bump, please i can't find it. It probaly would be a basic thing but i dont know it
Reply
#4

pawn Код:
if(strcmp(cmd, "/enter2", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 1337)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), -1833.2200, -16.1694, 15.1172);
                }
                else
                {
                    SetPlayerPos(playerid, -1833.2200, -16.1694, 15.1172);
                }
                return 1;
            }
        }
        return 1;
    }
Reply
#5

Great it works now, awesome

Only one question left, i want that command useable only in an certain area, i mean i want that you can only type that infront of the gate, not everywhere
Reply
#6

if(IsPlayerInRangeOfPoint(playerid,range,x,y,z))
Reply
#7

Quote:
Originally Posted by biltong
if(IsPlayerInRangeOfPoint(playerid,range,x,y,z))
Nice, it works thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)