SA-MP Forums Archive
Explosive Barrel - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Explosive Barrel (/showthread.php?tid=141985)



Explosive Barrel - Ironboy500 - 16.04.2010

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


Re: Explosive Barrel - brett7 - 16.04.2010

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


Re: Explosive Barrel - Adil - 16.04.2010

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.


Re: Explosive Barrel - brett7 - 16.04.2010

fine then doesn't make any difference though


Re: Explosive Barrel - Adil - 16.04.2010

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.


Re: Explosive Barrel - DRIFT_HUNTER - 16.04.2010

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


Re: Explosive Barrel - Adil - 16.04.2010

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.


Re: Explosive Barrel - Ironboy500 - 17.04.2010

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


Re: Explosive Barrel - Correlli - 17.04.2010

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.


Re: Explosive Barrel - brett7 - 17.04.2010

hi ironboy

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


Re: Explosive Barrel - Ironboy500 - 17.04.2010

Where can I change it?


Re: Explosive Barrel - Correlli - 17.04.2010

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


Re: Explosive Barrel - Ironboy500 - 17.04.2010

Is there anyway to make effect on everyone?


Re: Explosive Barrel - Correlli - 17.04.2010

No, or at least not yet.


Re: Explosive Barrel - aircombat - 17.04.2010

2 is originally KEY_SUBMISSION (i think)