SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 16/04/2010, 02:24 PM   #1
Ironboy500
Huge Clucker
 
Join Date: Jul 2009
Posts: 284
Reputation: 0
Default Explosive Barrel

Hello!
I need help in creating 'Dropping Explosive Barrels system'
So when player press number '2' he drop explosive barrel behind him.
Any help?
Ironboy500 is offline  
Old 16/04/2010, 05:20 PM   #2
brett7
Gangsta
 
brett7's Avatar
 
Join Date: Nov 2007
Location: samp is #1
Posts: 669
Reputation: 14
Default Re: Explosive Barrel

pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys==KEY_FIRE))

    {
       
            new Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:az;
            GetPlayerPos(playerid,x,y,z);
            CreateObject(barrelid, x, y+1, z, 0, 0, 0);
       
    }
    return 1;
}

very basic but you get the idea
brett7 is offline  
Old 16/04/2010, 05:55 PM   #3
Adil
Gangsta
 
Adil's Avatar
 
Join Date: Aug 2008
Posts: 860
Reputation: 20
Default Re: Explosive Barrel

Quote:
Originally Posted by brett7
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys==KEY_FIRE))

{

new Float,Float:y,Float:z,Float2,Float:y2,Float:az ;
GetPlayerPos(playerid,x,y,z);
CreateObject(barrelid, x, y+1, z, 0, 0, 0);

}
return 1;
}

very basic but you get the idea
You should use the /pawn BBC code for posting a script.
__________________
Signature

My Works
[NPC]LS Bus System
[MAP]Mansion

Adil is offline  
Old 16/04/2010, 06:03 PM   #4
brett7
Gangsta
 
brett7's Avatar
 
Join Date: Nov 2007
Location: samp is #1
Posts: 669
Reputation: 14
Default Re: Explosive Barrel

fine then doesn't make any difference though
brett7 is offline  
Old 16/04/2010, 06:09 PM   #5
Adil
Gangsta
 
Adil's Avatar
 
Join Date: Aug 2008
Posts: 860
Reputation: 20
Default Re: Explosive Barrel

Quote:
Originally Posted by brett7
fine then doesn't make any difference though
It does, it's more easy for the readers to read your script, otherwise, it will look scattered and messed up.
__________________
Signature

My Works
[NPC]LS Bus System
[MAP]Mansion

Adil is offline  
Old 16/04/2010, 06:16 PM   #6
DRIFT_HUNTER
High-roller
 
Join Date: Oct 2009
Posts: 2,127
Reputation: 211
Default Re: Explosive Barrel

Quote:
Originally Posted by Adil_Rahoo
Quote:
Originally Posted by brett7
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys==KEY_FIRE))

{

new Float,Float:y,Float:z,Float2,Float:y2,Float:az ;
GetPlayerPos(playerid,x,y,z);
CreateObject(barrelid, x, y+1, z, 0, 0, 0);

}
return 1;
}

very basic but you get the idea
You should use the /pawn BBC code for posting a script.
Quote:
Originally Posted by Adil_Rahoo
Quote:
Originally Posted by brett7
fine then doesn't make any difference though
It does, it's more easy for the readers to read your script, otherwise, it will look scattered and messed up.
what is hard to read here and what is messed up?
simple and useful
DRIFT_HUNTER is offline  
Old 16/04/2010, 06:21 PM   #7
Adil
Gangsta
 
Adil's Avatar
 
Join Date: Aug 2008
Posts: 860
Reputation: 20
Default Re: Explosive Barrel

Quote:
Originally Posted by DRIFT_HUNTER
what is hard to read here and what is messed up?
simple and useful
He edited his post. Check before you post a reply.
__________________
Signature

My Works
[NPC]LS Bus System
[MAP]Mansion

Adil is offline  
Old 17/04/2010, 12:39 PM   #8
Ironboy500
Huge Clucker
 
Join Date: Jul 2009
Posts: 284
Reputation: 0
Default Re: Explosive Barrel

Hey brett
I know how to make barrel dropping, but my problem is number '2', is KEY_FIRE number '2'?
Ironboy500 is offline  
Old 17/04/2010, 12:43 PM   #9
Correlli
Godfather
 
Correlli's Avatar
 
Join Date: May 2009
Location: Slovenia
Posts: 6,340
Reputation: 365
Default Re: Explosive Barrel

Quote:
Originally Posted by Ironboy500
my problem is number '2', is KEY_FIRE number '2'?
KEY_FIRE is the key you set in your settings for your fire key.
Correlli is offline  
Old 17/04/2010, 01:25 PM   #10
brett7
Gangsta
 
brett7's Avatar
 
Join Date: Nov 2007
Location: samp is #1
Posts: 669
Reputation: 14
Default Re: Explosive Barrel

hi ironboy

yeah just change the KEY_FIRE bit to what you want, fire key is normally ctrl i think
brett7 is offline  
 

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
[Need Help] Explosive Help. Hash [NL-RP] Help Archive 3 11/05/2010 02:25 AM
[FilterScript] [FS]Explosive Bullet's [Servidor R7 Necessario] GhOsT[X] Lanšamentos/Releases 8 02/04/2010 02:27 PM
Adding Explosive Barrels? DJDhan Help Archive 5 10/12/2009 08:31 AM
Explosive Barrel (Timer Bomb) virspector Filterscripts 11 19/09/2009 08:00 AM
Explosive barrel bug?? MB@ Client Support 3 26/08/2009 05:39 AM


All times are GMT. The time now is 09:47 PM.


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