show environment/map of SA at onplayerrequestclass, how?
#1

hey guys,

im trying to make something that when a player connects he sees all kinds of npc jumping,drifting,hydraulic jumping, etc, for the effect XD

but i am stuck at a problem, when at onplayerrequestclass and setting the camera at grove street where the npcs are busy, it doesnt really shows the map clearly... it shows it for a part, a bit hazy, i hope you know what screen i mean, but my question is, how can i make it that it DOES shows the environment? i already putted a timer on it for 4 seconds so it gets time to load but still doesnt , anyways here is my onplayerreqesutclass and the timer i use:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
        if(IsPlayerNPC(playerid))
        {
            new npcname[MAX_PLAYER_NAME];
            GetPlayerName(playerid, npcname, sizeof(npcname)); //De naam aanvragen
            if(!strcmp(npcname, "Wheelie_NPC", true)) //Kijken of de naam klopt
            {
                PutPlayerInVehicle(playerid,StartNPCVehicle, 0);
            }
            else if(!strcmp(npcname, "Drift_NPC", true)) //Kijken of de naam klopt
            {
                PutPlayerInVehicle(playerid,DriftNPCVehicle, 0);
            }
            else if(!strcmp(npcname, "Jump_NPC", true)) //Kijken of de naam klopt
            {
                PutPlayerInVehicle(playerid,JumpNPCVehicle, 0);
            }
            return 1;
        }
        SetTimerEx("HoldPlayer", 3000, false, "d", playerid);
        SendClientMessage(playerid, COLOR_RED, "Loading your garage...");
        SetPlayerCameraPos(playerid, 2489.9321,-1670.1495,13.3359);
        SetPlayerCameraLookAt(playerid, 2496.1956,-1666.6605,13.3179);
        return 1;
}
forward HoldPlayer(playerid);
public HoldPlayer(playerid)
{
    SetSpawnInfo(playerid,0,0,2664.1328,-1995.8257,13.5547,180.0,0,0,0,0,0,0);
    SpawnPlayer(playerid);
    return 1;
}
i hope you know there is a function for this

greets niels
Reply
#2

https://sampwiki.blast.hk/wiki/SetPlayerCameraPos
https://sampwiki.blast.hk/wiki/SetPlayerCameraLookAt

Using those is right, but if I'm correct you need to actually set the player position to the location of the NPCs so the environment will be streamed in.
Reply
#3

The player must be in range of the location, otherwise you will only see LOD (Low Object Detail) objects.
Reply
#4

In other words, use SetPlayerPos before the SetPlayerCameraPos/LookAt.
Reply
#5

ah lool XD never thought of that XD, thnx for the help guys

but do also do i have to use SpawnPlayer(playerid); before using setplayerpos? or not?

btw rep+
Reply
#6

Put SpawnPlayer in the end of code.
Reply
#7

well i have a timer which starts at connect... after 8 seconds it will spawn the player... should that work? D:
Reply
#8

Put the SetPlayerPos next to SetPlayerCameraPos in OnPlayerRequestClass.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)