SA-MP Forums Archive
Objects in class selection - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Objects in class selection (/showthread.php?tid=147196)



Objects in class selection - MummyKillerSLO - 10.05.2010

Hi people!

I have little problem. I am using Streamer Plugin and I made few objects in my server for the class selection. The problem is, when player connect and get to the class selection, there is no objects ... Is there any way to spawn obejcts before class selection or something?


Re: Objects in class selection - BigM - 10.05.2010

Go to:
pawn Код:
OnPlayerRequestClass
And there add your created objects
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    CreateObject(playerid,x,y,z);
return 1;



Re: Objects in class selection - Donny_k - 10.05.2010

Quote:
Originally Posted by BigM
Go to:
pawn Код:
OnPlayerRequestClass
And there add your created objects
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    CreateObject(playerid,x,y,z);
return 1;
That's bugged code (modelid) and also creating an object each time he requests a class isn't a good idea for many reasons dude, you will end up with a ton of objects for one.

pawn Код:
public OnGameModeInit()
{
  // all init code
  // create code here, native CreateObject( model, x, y, z, ..................
  return 1;
}
Better to just create one global object for everyone to see in the native format and not a streamed one as you have no x,y,z axes data before you are spawned onto the map so the streamer can't possibly stream one for you due to how they work (distance to x,y,z then create or destroy).


Re: Objects in class selection - FlatMaN - 10.05.2010

Код:
new Object1;
new Object2;
//etc..

public OnPlayerRequestClass(playerid, classid)
{
  Object1 = CreatePlayerObject(playerid, modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ)
  Object2 = CreatePlayerObject(playerid, modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ);
  //etc..
  return 1;
}

public OnPlayerSpawn(playerid)
{
  DestroyPlayerObject(playerid, Object1);
  DestroyPlayerObject(playerid, Object2);
  //etc..
  return 1;
}



Re: Objects in class selection - MummyKillerSLO - 10.05.2010

Thanks for the help guys, but as I said I am using Streamer Plugin with CreateDynamicObject stuff... With CreateObject is working but I must do this with Streamer. Any help?


Re: Objects in class selection - MummyKillerSLO - 10.05.2010

Tried and not work... :/ Sorry


Re: Objects in class selection - luigifan9 - 10.05.2010

Quote:
Originally Posted by MummyKillerSLO
Tried and not work... :/ Sorry
PM me your Onplyaerclassrequest script and maybe i can help.