[NEED HELP] New problem with interiors
#1

this is code
Код:
    if (strcmp(cmdtext, "/Enter", true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, 1553.5604, -1675.2515, 16.1953))
        {
            SetPlayerPos(playerid, 246.783996,63.900199,1003.640625);//LSPD enter
            print("Please Wait,objects have loading ");
            TogglePlayerControllable(playerid,0);
            SetTimerEx("Unfreeze", 8000, false, "i", playerid);
        }
        else
        {
            SendClientMessage(playerid,-1, ""RED"You are't near any entry point");
            return 1;
        }
    }
    if (strcmp(cmdtext, "/exit", true, 10) == 0)
    {
		if (IsPlayerInRangeOfPoint(playerid, 2.0, 246.783996,63.900199,1003.640625))//lspd exit
		{
		    print(" You leave LSPD Building ");
			SetPlayerPos(playerid,  1553.5604, -1675.2515, 16.1953);//lspd entry
		}
		else
		{
		    SendClientMessage(playerid,-1, ""RED"You are't near any exit point");
		    return 1;
		}
	}
    return 0;
}

forward Unfreeze(playerid);
public Unfreeze(playerid)
{
    print("Objects loaded");
    TogglePlayerControllable(playerid,1);
    return 1;
}

Problems:


1.but in game when i use /enter after spawn on interior
server send unknown command

2.i set timer on 8sec,but after end time player fall down from interior and dont stay on it also i dont spot ground of interior

whats problem?
Reply
#2

About the /enter , I don't know but I think it's because on the script it's /Enter not /enter
Reply
#3

i check it but dont work



whats problem??
why interior dont accept player
Reply
#4

Probably because you don't return 1 after the command, only if you aren't near the entrance point, therefore it continues on until it reaches return 0 which makes it return SERVER: Unknown command.

This should work for not returning Unknown Command.

pawn Код:
if (strcmp(cmdtext, "/Enter", true, 10) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 1553.5604, -1675.2515, 16.1953))
    {
        SetPlayerPos(playerid, 246.783996,63.900199,1003.640625);//LSPD enter
        print("Please Wait,objects have loading ");
        TogglePlayerControllable(playerid,0);
        SetTimerEx("Unfreeze", 8000, false, "i", playerid);
    }
    else
    {
        SendClientMessage(playerid,-1, ""RED"You are't near any entry point");
    }
    return 1;
}
EDIT: Ahh, yes, you might need a specific interior that you are forgetting to set when you enter. Do what the person below me replied.
Reply
#5

Код:
if (strcmp(cmdtext, "/Enter", true, 10) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 1553.5604, -1675.2515, 16.1953))
    {
        SetPlayerPos(playerid, 246.783996,63.900199,1003.640625);//LSPD enter
        SetPlayerInterior(playerid, the interior);//change the interior with the interior id
        print("Please Wait,objects have loading ");
        TogglePlayerControllable(playerid,0);
        SetTimerEx("Unfreeze", 8000, false, "i", playerid);
    }
    else
    {
        SendClientMessage(playerid,-1, ""RED"You are't near any entry point");
    }
    return 1;
}
you forgot SetPlayerInterior im not really sure but i don't think it matters about Enter or enter*not sure)
Reply
#6

i fix unknown command prob

but about interiors

no after freeze time end i fall down
interori arent load to keep me on it

when i use /enter
he change player pos to interior and player freeze on air on interior also a few part of interior load like cells but other parts
Reply
#7

I told you SetPlayerInterior what interior is it and set the player in that interior
this page can help
http://weedarr.wikidot.com/interior
use ******
Reply
#8

Код:
if (strcmp(cmdtext, "/Enter", true, 10) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 1553.5604, -1675.2515, 16.1953))
    {
        SetPlayerPos(playerid, 246.783996,63.900199,1003.640625);//LSPD enter
        SetPlayerInterior(playerid, 6);//change the interior with the interior id
        print("Please Wait,objects have loading ");
        TogglePlayerControllable(playerid,0);
        SetTimerEx("Unfreeze", 8000, false, "i", playerid);
    }
    else
    {
        SendClientMessage(playerid,-1, ""RED"You are't near any entry point");
    }
    return 1;
}
Reply
#9

oh yes
it work
tank you very much
Reply
#10

you welcome i told you SetPlayerInterior.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)