SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/09/2019, 02:11 PM   #1
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 515
Reputation: 18
Default Actor doubt

So i have a little doubt.

Imagine i have 3 Clucking Bell interiors, each one with a different virtual world.

Now i wanna create an actor for all this 3 Cluckin Bells, so my question is:

Is necessary to set a virtual world when creating the actor?

Can't i just take Cluckin Bell interior coordinates (Because they all share the same interior, only VW is different) and spawn the actor right there, so it'll be visibile in all cluckin bells even with different VW's?
__________________


Discord | Play Now | Website

Add your server to favourites and join our Discord.
Symon is offline   Reply With Quote
Old 13/09/2019, 02:27 PM   #2
Bolex_
Gangsta
 
Bolex_'s Avatar
 
Join Date: Aug 2015
Location: Croatia.
Posts: 592
Reputation: 117
Default Re: Actor doubt

Quote:
Originally Posted by Kalcor View Post
The interior IDs are GTA's streaming worlds (client streamed). The virtual world IDs are SA-MP's streaming worlds (on the server).

It's much better to set each GTA interior in it's own virtual world on the server. That means when you teleport a player in to a GTA interior, you also change the player's virtual world to some arbitrary number. That means the same GTA interior can be reused over and over. Players using the same GTA interior in a different virtual world won't be able to see each other or any actors set to a different virtual world.

You don't need to alter the actor's GTA interior because players set to that interior will always see other players, NPCs and actors that are in the same interior as them.

Code:
CreateDynamicActor(modelid, Float:x, Float:y, Float:z, Float:r, invulnerable = 1, Float:health = 100.0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_ACTOR_SD, areaid = -1, priority = 0)
Alternatively you can use Streamer_SetIntData or Streamer_SetArrayData and use an array filled with all virtualworlds the Actor should appear in.

Code:
new virtualworlds[] = {12, 13, 14, 15, .., ..., ...};
Streamer_SetArrayData(STREAMER_TYPE_ACTOR, actorid, E_STREAMER_WORLD_ID, virtualworlds);
Bolex_ is offline   Reply With Quote
Old 13/09/2019, 02:39 PM   #3
Jonny
Huge Clucker
 
Jonny's Avatar
 
Join Date: Nov 2009
Location: Italy
Posts: 284
Reputation: 38
Default Re: Actor doubt

Quote:
Originally Posted by Bolex_ View Post
Code:
CreateDynamicActor(modelid, Float:x, Float:y, Float:z, Float:r, invulnerable = 1, Float:health = 100.0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_ACTOR_SD, areaid = -1, priority = 0)
Alternatively use can use Streamer_SetIntData or Streamer_SetArrayData and use an array filled with all virtualworlds the Actor should appear in.

Code:
new virtualworlds[] = {12, 13, 14, 15, .., ..., ...};
Streamer_SetArrayData(STREAMER_TYPE_ACTOR, actorid, E_STREAMER_WORLD_ID, virtualworlds);
Didn't knew about this tbh, didn't even knew that streamer had actors too...

Anyway, you can't with native actors, you should make an actor for each business, you can do it by putting the vars directly into your business system, so you'd create it in LoadBusiness
__________________
Jonny is offline   Reply With Quote
Old 13/09/2019, 03:13 PM   #4
Hazon
Big Clucker
 
Hazon's Avatar
 
Join Date: May 2018
Location: Who cares ?
Posts: 139
Reputation: 18
Default Re: Actor doubt

Quote:
Originally Posted by darkdrago View Post
Didn't knew about this tbh, didn't even knew that streamer had actors too...

Anyway, you can't with native actors, you should make an actor for each business, you can do it by putting the vars directly into your business system, so you'd create it in LoadBusiness
You are trying to act smart ? iI suppose he just gave a state with a qoute of Kalcor that! he can't do that! and he give him an example of code to create actors with this native instead of multiple repeating code with var. (I think so).
Hazon is offline   Reply With Quote
Old 13/09/2019, 03:23 PM   #5
Jonny
Huge Clucker
 
Jonny's Avatar
 
Join Date: Nov 2009
Location: Italy
Posts: 284
Reputation: 38
Default Re: Actor doubt

Quote:
Originally Posted by Hazon View Post
You are trying to act smart ? He gave a state with and qoute of Kalcor he can't do that and give him an example to create actors with this native instead of multiple repeating code with var. (I think so).
Yeah i do, i'm trying to act smart surely...
This is a community where people asks for help and gets helped, where the f**k you see me trying to "act smart"?
The quote was because i didn't knew streamer had Actors support.
The things about the native functions i writter were for KeyOfKey since he was asking if that was possible and he didn't specified if he wanted to use Streamer or not so i gave him a reply.

Quote:
Originally Posted by Hazon View Post
Jesus... Do you know how to read ? I'm asking is it possible to make a move route for ballons like we can do for NPC's...

https://dev.prineside.com/gtasa_samp.../408-balloons/
See how do you react when people tries to help you, if you can't stay in a community then get out of here and keep your toxicity away from here, when you'll make your scripting help threads, you'll surely get no answers with your attitude, trust me.
__________________
Jonny is offline   Reply With Quote
Old 13/09/2019, 04:42 PM   #6
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 515
Reputation: 18
Default Re: Actor doubt

Ok chill out guys. Make the love not the war

Returning to the topic, i've a dynamic actors system, i place all actors in an array and i load them on OnGameModeInit.

So as far as i understood, i need to create an actor for each VW, right?
__________________


Discord | Play Now | Website

Add your server to favourites and join our Discord.
Symon is offline   Reply With Quote
Old 13/09/2019, 04:48 PM   #7
DRIFT_HUNTER
High-roller
 
Join Date: Oct 2009
Posts: 2,073
Reputation: 188
Default Re: Actor doubt

If you use native actors then yes, you need to create actor for each virtual world. If you use streamer then you can pass -1 as world and it will create actor in every world (to put it simply).
__________________
Looking for someone to start drifting server, drop me a pm if you are interested.


Any PM's that include question about any kind of help will be ignored.
Use appropriate boards for that
DRIFT_HUNTER is offline   Reply With Quote
Old 13/09/2019, 05:07 PM   #8
CheezIt
Big Clucker
 
CheezIt's Avatar
 
Join Date: Apr 2017
Posts: 182
Reputation: 17
Default Re: Actor doubt

You'd want an actor for each business/place if you're going to apply animations
__________________
I'd like to bring back my old CNR server that was created from scratch & hosted years ago. I'll host & update everything (including the website & forum). You would pay for hosted tab and help manage the community. PM me if you're interested!
CheezIt is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Doubt KinderClans Scripting Help 2 16/08/2018 10:23 PM
How to stop actor's animation after the Player stops targetting actor? humayunaftabkhan02 Scripting Help 0 05/05/2016 09:12 PM
SQL doubt and need some help Fernado Samuel Scripting Help 1 13/09/2013 09:26 PM
I have a doubt. seiscientos40 Help Archive 8 07/08/2011 09:58 AM


All times are GMT. The time now is 08:52 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.