SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 13/05/2018, 10:26 PM   #4541
gmaned
Little Clucker
 
gmaned's Avatar
 
Join Date: Nov 2011
Posts: 8
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

Hello.
Please give an example of how to create the right "actor" to be killed? And that doesn't apply to his vulnerability.
gmaned is offline   Reply With Quote
Old 13/05/2018, 10:49 PM   #4542
CodeStyle175
Huge Clucker
 
CodeStyle175's Avatar
 
Join Date: Apr 2014
Posts: 346
Reputation: 19
Default Re: Little coding questions - For general minor queries 5

http://wiki.sa-mp.com/wiki/SetActorInvulnerable
CodeStyle175 is offline   Reply With Quote
Old 14/05/2018, 07:09 AM   #4543
gmaned
Little Clucker
 
gmaned's Avatar
 
Join Date: Nov 2011
Posts: 8
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by CodeStyle175 View Post
i mean this - https://youtu.be/4GLII7EX24g
gmaned is offline   Reply With Quote
Old 14/05/2018, 08:37 AM   #4544
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,781
Reputation: 230
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by gmaned View Post
Static actor:
Use the function given above and be sure you re-stream the actor before trying to shot him.

Dynamic actor:
PHP Code:
SetDynamicActorInvulnerable(actoridinvulnerable 1
Set invulnerable to 0 if you want the actor receive damages. Nothing more is required.
__________________
actor_plus - v4.1.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 14/05/2018, 03:18 PM   #4545
gmaned
Little Clucker
 
gmaned's Avatar
 
Join Date: Nov 2011
Posts: 8
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Dayrion View Post
Static actor:
Use the function given above and be sure you re-stream the actor before trying to shot him.

Dynamic actor:
PHP Code:
SetDynamicActorInvulnerable(actoridinvulnerable 1
Set invulnerable to 0 if you want the actor receive damages. Nothing more is required.
Code:
new ActorS;

public OnGameModeInit()
{
// actors
	ActorS = CreateActor(294, 1958.3783, 1343.1572, 15.3746, 0);
    SetActorInvulnerable(ActorS, 0);
	SetActorHealth(ActorS, 99);
// mod
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1970.3783, 1343.1572, 15.3746, 269.1425, 24, 111, 0, 0, 0, 0);
	AddStaticVehicle(522,2034.6776,1349.3394,10.8203,179.63,0,0);
	
	return 1;
}
it's all what is have
and i cant kill him :C
gmaned is offline   Reply With Quote
Old 14/05/2018, 03:30 PM   #4546
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,781
Reputation: 230
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by gmaned View Post
Code:
new ActorS;

public OnGameModeInit()
{
// actors
	ActorS = CreateActor(294, 1958.3783, 1343.1572, 15.3746, 0);
    SetActorInvulnerable(ActorS, 0);
	SetActorHealth(ActorS, 99);
// mod
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1970.3783, 1343.1572, 15.3746, 269.1425, 24, 111, 0, 0, 0, 0);
	AddStaticVehicle(522,2034.6776,1349.3394,10.8203,179.63,0,0);
	
	return 1;
}
it's all what is have
and i cant kill him :C
I, and some people, occurred the same problem as well. You can use actor_plus (link in my signature).
You have multiple callbacks related to damage, hit, etc...
PHP Code:
forward OnPlayerShotActor(playeridactoridweaponidbool:IsDynamicActor);
forward OnPlayerTargetActor(playeridactoridweaponid);
forward OnPlayerStopTargetActor(playeridactoridweaponid);
forward OnPlayerMakeDamageToActor(playeriddamaged_actoridFloat:amountweaponidbodypartbool:deathbool:IsDynamicActor);
forward OnActorDeath(actoridkilleridreasonbool:IsDynamicActor); 
__________________
actor_plus - v4.1.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 14/05/2018, 09:18 PM   #4547
gmaned
Little Clucker
 
gmaned's Avatar
 
Join Date: Nov 2011
Posts: 8
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Dayrion View Post
I, and some people, occurred the same problem as well. You can use actor_plus (link in my signature).
You have multiple callbacks related to damage, hit, etc...
PHP Code:
forward OnPlayerShotActor(playeridactoridweaponidbool:IsDynamicActor);
forward OnPlayerTargetActor(playeridactoridweaponid);
forward OnPlayerStopTargetActor(playeridactoridweaponid);
forward OnPlayerMakeDamageToActor(playeriddamaged_actoridFloat:amountweaponidbodypartbool:deathbool:IsDynamicActor);
forward OnActorDeath(actoridkilleridreasonbool:IsDynamicActor); 
pawn tell me - actor_plus.inc(1586) : warning 203: symbol is never used: "isdynamic"
gmaned is offline   Reply With Quote
Old 14/05/2018, 09:45 PM   #4548
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,781
Reputation: 230
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by gmaned View Post
pawn tell me - actor_plus.inc(1586) : warning 203: symbol is never used: "isdynamic"
Make sure you have Zeex's compiler.
__________________
actor_plus - v4.1.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 14/05/2018, 09:54 PM   #4549
gmaned
Little Clucker
 
gmaned's Avatar
 
Join Date: Nov 2011
Posts: 8
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Dayrion View Post
Make sure you have Zeex's compiler.
I am sure.
The first time he wrote to download. I downloaded it.
Now writes this.
gmaned is offline   Reply With Quote
Old 15/05/2018, 02:50 PM   #4550
gmaned
Little Clucker
 
gmaned's Avatar
 
Join Date: Nov 2011
Posts: 8
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

Why doesn't it work for others?
Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(newkeys == 1024)
	{
	if (IsActorToPoint(2.0, playerid, ActorS))
	{
	ApplyActorAnimation(ActorS, "ped", "IDLE_chat", 2.1, 0, 0, 0, 0, 0);
	if (IsActorToPoint(2.0, playerid, ActorFBI_1))
	{
	ApplyActorAnimation(ActorFBI_1, "ped", "IDLE_chat", 2.1, 0, 0, 0, 0, 0);
	}
	if (IsActorToPoint(2.0, playerid, ActorFBI_2))
	{
	ApplyActorAnimation(ActorFBI_2, "ped", "IDLE_chat", 2.1, 0, 0, 0, 0, 0);
	}
	}
	}


	return true;
}
gmaned 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
how to make a soldier aotumaticly be general when the general dies ? AlbanianGuy Scripting Help 35 13/05/2012 03:35 PM
Minor problem Desert Help Archive 4 17/03/2010 06:24 PM
Counting with mysql queries actiwe Help Archive 2 26/02/2010 02:36 PM
SQL queries using GROUP BY Dabombber Help Archive 2 05/10/2009 07:47 PM


All times are GMT. The time now is 03:54 PM.


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