Explosive Barrel
#1

Hello!
I need help in creating 'Dropping Explosive Barrels system'
So when player press number '2' he drop explosive barrel behind him.
Any help?
Reply
#2

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
Reply
#3

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.
Reply
#4

fine then doesn't make any difference though
Reply
#5

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.
Reply
#6

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
Reply
#7

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.
Reply
#8

Hey brett
I know how to make barrel dropping, but my problem is number '2', is KEY_FIRE number '2'?
Reply
#9

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.
Reply
#10

hi ironboy

yeah just change the KEY_FIRE bit to what you want, fire key is normally ctrl i think
Reply
#11

Where can I change it?
Reply
#12

Quote:
Originally Posted by Ironboy500
Where can I change it?
In your GTA:SA controls, but that will only affect you.
Reply
#13

Is there anyway to make effect on everyone?
Reply
#14

No, or at least not yet.
Reply
#15

2 is originally KEY_SUBMISSION (i think)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)