SA-MP Forums Archive
Some interior || virtual world bug problem - 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: Some interior || virtual world bug problem (/showthread.php?tid=575077)



Some interior || virtual world bug problem - 7Ahmad7 - 23.05.2015

Guys look,in the class selection, I have all the skins in samp,But i sorted them with text-draws as Cops and citizen.
The problems are:

1)Cops:1-i made random spawn,when the skin spawns inside interior(LVPD)it is fine,but outside,near LVPD i see blank / screen (blue sky and very very far buildings)

2)Citizen:1-In the class selection i cannot see the class
2-after respawn,i can see the skin,but the same above blue blank sky screen.

What should i do?


Re: Some interior || virtual world bug problem - Bingo - 23.05.2015

Show us the codes.

Regarding the skin which you cannot see on Request Class is most probably x,y,z error, And regarding the cops blank screen issue is interior mostly, Show us the codes.


Re: Some interior || virtual world bug problem - 7Ahmad7 - 23.05.2015

Okay,Those are the codes for Requestclass :
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    //-----some scripter HHH
    for (new a = 0; a <= 312; a++) if(classid == SkinClass[a])
    {
            switch(SkinClass[a])
            {
                    case 0..279, 289..299:
                    {
                            GameTextForPlayer( playerid, "~r~Al-nas", 300, 3 );
                            SetPlayerPos(playerid, 349.22, 30306, 1000.13);
                            SetPlayerFacingAngle(playerid, 187.3405);
                            SetPlayerInterior(playerid, 6);
                            SetPlayerCameraPos(playerid, 347.58, 303.12, 999.15);
                            SetPlayerCameraLookAt(playerid, 349.22, 30306, 1000.13);
                            SetPlayerVirtualWorld(playerid, 0);
                    }
                    case 280..288, 300..311:
                    {
                            GameTextForPlayer( playerid, "~b~POLES", 300, 3 );
                            SetPlayerPos(playerid, 231.6830, 165.2193, 1003.9044);
                            SetPlayerFacingAngle(playerid, 263.6608);
                            SetPlayerInterior(playerid, 3);
                            SetPlayerCameraPos(playerid, 234.17, 165.77, 1004.02);
                            SetPlayerCameraLookAt(playerid, 231.6830, 165.2193, 1003.9044);
                            SetPlayerVirtualWorld(playerid, 0);
                    }
            }
            break;
    }
    return 1;
}
And that is the code for spawn (both cops and citizens are bugged here):
pawn Код:
public OnPlayerSpawn(playerid)
switch (GetPlayerTeam(playerid))
{
    case TEAM_POLES:
    {
        new Random = random(sizeof(RandomSpawns));
        SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1],RandomSpawns[Random][2]);
        SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
    }
    case TEAM_ALNAS:
    {
        new Rand = random(sizeof(RandSpawns));
        SetPlayerPos(playerid, RandSpawns[Rand][0], RandSpawns[Rand][1],RandSpawns[Rand][2]);
        SetPlayerFacingAngle(playerid, RandSpawns[Rand][3]);
        SetPlayerInterior(playerid, 1);
    }
}



Re: Some interior || virtual world bug problem - 7Ahmad7 - 23.05.2015

Hey.....


Re: Some interior || virtual world bug problem - Jefff - 24.05.2015

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerVirtualWorld(playerid, 0);
    if(0 <= SkinClass[classid] <= 279 || 289 <= SkinClass[classid] <= 299)
    {
        GameTextForPlayer( playerid, "~r~Al-nas", 300, 3 );
        SetPlayerPos(playerid, 349.22, 30306, 1000.13);
        SetPlayerFacingAngle(playerid, 187.3405);
        SetPlayerInterior(playerid, 6);
        SetPlayerCameraPos(playerid, 347.58, 303.12, 999.15);
        SetPlayerCameraLookAt(playerid, 349.22, 30306, 1000.13);
    }
    else
    {
        GameTextForPlayer( playerid, "~b~POLES", 300, 3 );
        SetPlayerPos(playerid, 231.6830, 165.2193, 1003.9044);
        SetPlayerFacingAngle(playerid, 263.6608);
        SetPlayerInterior(playerid, 3);
        SetPlayerCameraPos(playerid, 234.17, 165.77, 1004.02);
        SetPlayerCameraLookAt(playerid, 231.6830, 165.2193, 1003.9044);
    }
    return 1;
}
+ you need use SetPlayerTeam(playerid,TEAM_HERE); or in AddPlayerClassEx ?


Re: Some interior || virtual world bug problem - 7Ahmad7 - 24.05.2015

It is same result as the old code,used the old code again....

Anyideas?


Re: Some interior || virtual world bug problem - 7Ahmad7 - 24.05.2015

By the way i have fixed everything,but i got those warnings :

pawn Код:
new Float:RandSpawns[][5] =
{
    {198.3130,168.7895,1003.0234,279.8719,3}, // LVPolice5
    {195.3844,178.5444,1003.0234,267.6113,3}, // LVPolice6
    {217.7533,184.4308,1003.0313,180.5899,3}, // LVPolice7
    {253.0199,189.4483,1008.1719,267.2993,3}, // LVPolice8
    {297.2448,183.1777,1007.1719,114.2658,3}, // LVPolice9
    {230.8077,167.2818,1003.0234,178.3830,3}, // LVPolice10
    {2337.7937,2455.1116,14.9688,85.4441,0}, // lvpolice11
    {2286.5898,2429.0000,10.8203,180.0716,0}, // lvpolice12
    {2238.6660,2449.2288,11.0372,88.8440,0}, // lvpolice13
    {2253.4731,2457.5869,10.8203,92.2906,0}, // lvpolice14
    {2295.7310,2468.8147,10.8203,99.3290,0}, // lvpolice15
    {2295.4824,2451.9346,10.8203,84.6022,0}, // lvpolice16
    {2251.4565,2490.0515,10.9908,174.3613,0}, // lvpolice17
    {2307.2654,2446.4929,10.8203,172.7947,0} // lvpolice18
};
And on this too:
pawn Код:
SetPlayerInterior(playerid, RandSpawns[Rand][4]);
I get warning 213 on all the codes above : Tag Mismatch
Any ideas?


Re: Some interior || virtual world bug problem - Konstantinos - 24.05.2015

The array have Float: tag so it can't have interior there as integer.

Check: https://sampwiki.blast.hk/wiki/Keywords:Initialisers#enum

You can have x, y, z, angle and interior for a specific array but you use the names used in the enumerator instead of [0/1/2/3/4]


Re: Some interior || virtual world bug problem - 7Ahmad7 - 24.05.2015

Hey look,I don't use enums,Okay?I use #define ,By the way,So isn't there anyway to set interiors for specific Pos's?


Re: Some interior || virtual world bug problem - Konstantinos - 24.05.2015

It wasn't for the teams but for the spawn points (floats) + interior (integer).

pawn Код:
enum e_RandSpawns
{
    Float: X,
    Float: Y,
    Float: Z,
    Float: Angle,
    Interior
};

new RandSpawns[][e_RandSpawns] =
{
    {198.3130,168.7895,1003.0234,279.8719,3}, // LVPolice5
    {195.3844,178.5444,1003.0234,267.6113,3}, // LVPolice6
    {217.7533,184.4308,1003.0313,180.5899,3}, // LVPolice7
    {253.0199,189.4483,1008.1719,267.2993,3}, // LVPolice8
    {297.2448,183.1777,1007.1719,114.2658,3}, // LVPolice9
    {230.8077,167.2818,1003.0234,178.3830,3}, // LVPolice10
    {2337.7937,2455.1116,14.9688,85.4441,0}, // lvpolice11
    {2286.5898,2429.0000,10.8203,180.0716,0}, // lvpolice12
    {2238.6660,2449.2288,11.0372,88.8440,0}, // lvpolice13
    {2253.4731,2457.5869,10.8203,92.2906,0}, // lvpolice14
    {2295.7310,2468.8147,10.8203,99.3290,0}, // lvpolice15
    {2295.4824,2451.9346,10.8203,84.6022,0}, // lvpolice16
    {2251.4565,2490.0515,10.9908,174.3613,0}, // lvpolice17
    {2307.2654,2446.4929,10.8203,172.7947,0} // lvpolice18
};
pawn Код:
printf("%i %f", RandSpawns[5][Interior], RandSpawns[10][Y]);
// output 3 and 2468.814697