new const Float:g_SpawnGrove[][4] = { {220.9889,1241.6044,1082.1406,245.6888}, {220.9889,1241.6044,1082.1406,245.6888}, {220.9889,1241.6044,1082.1406,245.6888} };
SetPlayerPos(playerid, 2496.049804, -1695.238159, 1014.742187); //coordinates of cjs house interior taken from http://weedarr.wikidot.com/interior SetPlayerInterior(playerid, 3); //This is how you put player in right interior
new const Float:g_SpawnGroves[][4] = { {2495.9788,-1709.5435,1014.7422,359.6140}, {2495.9788,-1709.5435,1014.7422,359.6140}, {2495.9788,-1709.5435,1014.7422,359.6140} };
SetPlayerPos(playerid, 2495.9788,-1709.5435,1014.7422,359.6140); SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid, 2495.9788, -1709.5435, 1014.7422); // X, Y, Z SetPlayerFacingAngle(playerid, 359.6140); // Angle SetPlayerInterior(playerid, 3);
new const Float:g_SpawnGroves[][4] = {
{2495.9788,-1709.5435,1014.7422,359.6140, interiorid},
{2495.9788,-1709.5435,1014.7422,359.6140, interiorid},
{2495.9788,-1709.5435,1014.7422,359.6140, interiorid}
};
new rpos = random(sizeof(g_SpawnGroves));
SetPlayerPos(playerid, g_SpawnGroves[rpos][0], g_SpawnGroves[rpos][1], g_SpawnGroves[rpos][2]);
SetPlayerInterior(playerid, g_SpawnGroves[rpos][3]);
PHP код:
PHP код:
|
new Float:g_SpawnGroves[][4] = { {2495.9788, -1709.5435, 1014.7422, 359.6140}, // X, Y, Z, Angle {2495.9788, -1709.5435, 1014.7422, 359.6140}, {2495.9788, -1709.5435, 1014.7422, 359.6140} };
new rpos = random(sizeof(g_SpawnGroves)); SetPlayerPos(playerid, g_SpawnGroves[rpos][0], g_SpawnGroves[rpos][1], g_SpawnGroves[rpos][2]); // X, Y, Z SetPlayerFacingAngle(playerid, g_SpawnGroves[rpos][3]); // Angle SetPlayerInterior(playerid, 3); // set the interior
new Float:g_SpawnGroves[][4] = {//we will make a variable containt of spawn locations as we select X, Y, Z, Angle
{2495.9788, -1709.5435, 1014.7422, 359.6140}, // X, Y, Z, Angle
{2495.9788, -1709.5435, 1014.7422, 359.6140},
{2495.9788, -1709.5435, 1014.7422, 359.6140},
{X, Y, Z, ANGLE}
};
new rpos = random(sizeof(g_SpawnGroves));//we will make a new varaible in which we will make the spawn location random so we can able to get the player position in SetPlayerPos
SetPlayerPos(playerid, g_SpawnGroves[rpos][0], g_SpawnGroves[rpos][1], g_SpawnGroves[rpos][2]); //Here we will set the position as X, Y, Z (0, 1, 2) [we are using 0, 1, 2 becuz we have (XYZ ANGLE = 4 positions] [0 = X] [1=Y] [2=Z] [3=Angle] so placed it see the code
SetPlayerFacingAngle(playerid, g_SpawnGroves[rpos][3]); // we will put the angle from another function cuz their is not function to set the angle in SetPlayerPos well you can make it ezly if you want to learn that then you can reply here.
SetPlayerInterior(playerid, 3); //As same as Angle we dont have function of interior in SetPlayerPos so we will use the SetPlayerInterior to set the player spawn interior well here the function i m talking about below.
stock SetPlayerPosEx(playerid, Float:X, Float:Y, Float:Z, Float:Angle, interiorid)
{
SetPlayerPos(playerid, X, Y, Z);
SetPlayerFacingAngle(playerid, Angle);
SetPlayerInterior(playerid, interiorid);
}
//SetPlayerPosEx(playerid, X, Y, Z, Angle, interiorid);
[its simple then above isn't it :D]
i cant place SetPlayerInterior(playerid, 3); in
Код:
new const Float:g_SpawnGroves[][4] = { {2495.9788,-1709.5435,1014.7422,359.6140}, {2495.9788,-1709.5435,1014.7422,359.6140}, {2495.9788,-1709.5435,1014.7422,359.6140} }; Код:
SetPlayerPos(playerid, 2495.9788,-1709.5435,1014.7422,359.6140); SetPlayerInterior(playerid, 3); |