How do i set the interior for a class spawn?
#6

Quote:
Originally Posted by CaptainBoi
Посмотреть сообщение
PHP код:
new const Float:g_SpawnGroves[][4] = {
    {
2495.9788,-1709.5435,1014.7422,359.6140interiorid},
    {
2495.9788,-1709.5435,1014.7422,359.6140interiorid},
    {
2495.9788,-1709.5435,1014.7422,359.6140interiorid}
}; 
its ezy make it like this
PHP код:
 new rpos random(sizeof(g_SpawnGroves));
       
SetPlayerPos(playeridg_SpawnGroves[rpos][0], g_SpawnGroves[rpos][1], g_SpawnGroves[rpos][2]);
    
SetPlayerInterior(playeridg_SpawnGroves[rpos][3]); 
Try it will work as u want
Not with the code you have provided! For a start you'll get an error if you insert the interior ID, which is an integer value into the array because the array is for floating point numbers. SetPlayerInterior will also only accept an integer value.

Код:
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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)