SA-MP Forums Actor Problem
 New Account Members List Search Today's Posts Mark Forums Read

 15/11/2017, 03:02 AM #1 hoanduy Big Clucker   Join Date: Oct 2016 Posts: 83 Reputation: 0 Actor Problem How to know if the Actor is having an animation will say "Actor is serving another person." Example: Actor is a shoemaker. - When Actor does not serve anyone else, I will interact with Actor and SetAnim for Actor. - When the Actor is serving someone, when I interact with the Actor it will say "Actor is serving other people."
 15/11/2017, 03:21 AM #2 Jaxium Little Clucker   Join Date: Nov 2017 Location: Egypt Posts: 11 Reputation: 1 Re: Actor Problem You simply create a global variable as [MAX_ACTORS] and when you SetAnim for an actor, you set that variable for that actorid to true, or to 1. When the actor finishes serving someone, you set it back to false, or to 0. And when someone interacts with an actor, you check if that actorid's variable is false or true, 0 or 1. If it's false, then for example the actor is not busy, and allows the interaction. If it's 1 or true, then the actor is busy and send that message to him.
15/11/2017, 03:29 AM   #3
hoanduy
Big Clucker

Join Date: Oct 2016
Posts: 83
Reputation: 0
Re: Actor Problem

Quote:
 Originally Posted by Jaxium You simply create a global variable as [MAX_ACTORS] and when you SetAnim for an actor, you set that variable for that actorid to true, or to 1. When the actor finishes serving someone, you set it back to false, or to 0. And when someone interacts with an actor, you check if that actorid's variable is false or true, 0 or 1. If it's false, then for example the actor is not busy, and allows the interaction. If it's 1 or true, then the actor is busy and send that message to him.
Can you give me some illustrative code ?

 15/11/2017, 05:07 AM #4 Ritzy2K High-roller     Join Date: Jun 2014 Location: India Posts: 1,547 Reputation: 170 Re: Actor Problem He pretty much explained it anyway but I'll try. (Sorry for any typos I'm on tab.) Code: ```new actorbusy[MAX_ACTORS]; // at top of your script with other variables CMD:shoemaker(playerid, params[]) { if(actorbusy[playerid] == 1) return SendClientMessage(playerid, -1, "Actor Is Busy."); // do your stuff here, applying anim and whatever. While doing that make sure to set this variable to 1 actorbusy[playerid] = 1; // When your actor finishes the job you can set it back to 0.``` If someone wants to correct me please feel free to do so. I'm back after pretty long so I'm rusty
15/11/2017, 10:46 AM   #5
hoanduy
Big Clucker

Join Date: Oct 2016
Posts: 83
Reputation: 0
Re: Actor Problem

Quote:
 Originally Posted by Jaxium You simply create a global variable as [MAX_ACTORS] and when you SetAnim for an actor, you set that variable for that actorid to true, or to 1. When the actor finishes serving someone, you set it back to false, or to 0. And when someone interacts with an actor, you check if that actorid's variable is false or true, 0 or 1. If it's false, then for example the actor is not busy, and allows the interaction. If it's 1 or true, then the actor is busy and send that message to him.
Quote:
 Originally Posted by Ritzy He pretty much explained it anyway but I'll try. (Sorry for any typos I'm on tab.) Code: ```new actorbusy[MAX_ACTORS]; // at top of your script with other variables CMD:shoemaker(playerid, params[]) { if(actorbusy[playerid] == 1) return SendClientMessage(playerid, -1, "Actor Is Busy."); // do your stuff here, applying anim and whatever. While doing that make sure to set this variable to 1 actorbusy[playerid] = 1; // When your actor finishes the job you can set it back to 0.``` If someone wants to correct me please feel free to do so. I'm back after pretty long so I'm rusty
Thank all, I have succeeded my system: D

 Thread Tools Display Modes Linear Mode

 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 Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post humayunaftabkhan02 Scripting Help 0 05/05/2016 08:12 PM eikzdej Scripting Help 4 29/03/2016 03:24 PM eikzdej Scripting Help 3 28/03/2016 04:00 PM Sanady Scripting Help 10 14/01/2016 03:32 AM Karolukas123 Scripting Help 6 07/07/2015 07:29 PM

All times are GMT. The time now is 12:05 PM.

 -- (EN) English -- (RU) Русски SA-MP - Archive - Top