SA-MP Forums Archive
[Include] [INC] TearGas System - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC] TearGas System (/showthread.php?tid=132507)

Pages: 1 2


[INC] TearGas System - Carlton - 07.03.2010

Some of you have seen me on the forums so far, i'm pretty much new to scripting, I'm a c++ coder and a PHP coder, so PAWN is easier for me atm.

I noticed people were releasing scripts here, and I thought, why not make something that isn't in SA-MP, like the teargas feature, so I simply, went into Pawno, and did my thing.

There are some functions I must explain, you can use them to activate the teargas.

Code:
native TearGas_OnPlayerConnect(playerid); - Use this to reset a players teargas.
native GivePlayerTearGas(playerid, amount); - Gives the player a certain amount of teargas.
native SetPlayerTearGas(playerid, amount); - Sets the player's teargas amount.
native GetPlayerTearGas(playerid); - Gets a players teargas amount.
Installing is very easy, open up your scripting editor, and add
Code:
#include <TearGas.inc>
this will enable you to use the functions, add this under a_samp

I've taken some pictures of the teargas effects etc..




Download available here:
http://pastebin.com/XcDCyK2K

Installation Guide
1: Put #include <TearGas.inc> in your script.
2: Put TearGas_OnPlayerConnect(playerid); in OnPlayerConnect.
3: Put TearGasOnPlayerKeyStateChange(playerid, newkeys); in OnPlayerKeyStateChange
4: If you're not going to use a function at the moment or never put, #pragma unused The Function Name. A example of that is: #pragma unused SetPlayerTearGas

Oh and, I couldn't find the cough animation, I tried my best to do what I can do.
This is my first release, I hope I did good


Re: [INC] TearGas System - speedruntrainer - 07.03.2010

Cool


Re: [INC] TearGas System - Carlton - 07.03.2010

Quote:
Originally Posted by speedruntrainer
Cool
Thanks. :P


Re: [INC] TearGas System - Calgon - 07.03.2010

Nice work, but it can be done easily in 2 functions, so it can be done better as more of a snippet, simply with OnPlayerKeyStateChange and then make a second function to initialize the teargas (though it's not that necessary). And it can be done using GetPlayerWeapon, instead of this alternative method you use to give teargas.


Re: [INC] TearGas System - Carlton - 07.03.2010

Quote:
Originally Posted by FreddoX [BINMAN
]
Nice work, but it can be done easily in 2 functions, so it can be done better as more of a snippet, simply with OnPlayerKeyStateChange and then make a second function to initialize the teargas (though it's not that necessary). And it can be done using GetPlayerWeapon, instead of this alternative method you use to give teargas.
I could of used GetPlayerWeapon, I didn't really like giving the players teargas as a weapon, because the amount of effort they throw it can effect the direction and mess up the smoke objects coordinates. I tried my best to make it a different way. Maybe using GetPlayerWeapon, and using GetPlayerWeaponData, can determine the amount of teargas a person has, I will try that out. Thanks for the nice work comment.


Re: [INC] TearGas System - Calgon - 07.03.2010

Quote:
Originally Posted by Carlton
Quote:
Originally Posted by FreddoX [BINMAN
]
Nice work, but it can be done easily in 2 functions, so it can be done better as more of a snippet, simply with OnPlayerKeyStateChange and then make a second function to initialize the teargas (though it's not that necessary). And it can be done using GetPlayerWeapon, instead of this alternative method you use to give teargas.
I could of used GetPlayerWeapon, I didn't really like giving the players teargas as a weapon, because the amount of effort they throw it can effect the direction and mess up the smoke objects coordinates. I tried my best to make it a different way. Maybe using GetPlayerWeapon, and using GetPlayerWeaponData, can determine the amount of teargas a person has, I will try that out. Thanks for the nice work comment.
No problem, it's excellent for a first release. If you do change it, you should probably change it to a filterscript though.


Re: [INC] TearGas System - Carlton - 07.03.2010

Quote:
Originally Posted by Seif_
Not bad. I made my own a long time ago also.
Thanks, is yours released? How did you make yours, with variables and objects or GetPlayerWeapon and GetPlayerWeaponData?


Re: [INC] TearGas System - MenaceX^ - 07.03.2010

pawn Code:
TearGas[playerid] == amount;
This actually should give you a warning.


Re: [INC] TearGas System - Carlton - 07.03.2010

Quote:
Originally Posted by MenaceX^
pawn Code:
TearGas[playerid] == amount;
This actually should give you a warning.
Oops, sorry, a little mistake. Here's a fixed link.
http://pastebin.com/b9H9MWTN


Re: [INC] TearGas System - MenaceX^ - 07.03.2010

I actually think it's much better to do it with variables only, because since MapAndreas of Kye exists it's much easier to do such things like that one.
Nice, anyway.


Re: [INC] TearGas System - Lejo - 08.03.2010

Nice. I'll be downloading this and messing around with it. Keep up the nice work, broski,


Re: [INC] TearGas System - Carlton - 08.03.2010

Quote:
Originally Posted by Shakur_
Nice. I'll be downloading this and messing around with it. Keep up the nice work, broski,
Thanks for the comment.


Re: [INC] TearGas System - Oxside - 08.03.2010

Cool system usefull for roleplay servers/scripts


Re: [INC] TearGas System - [MWR]Blood - 08.03.2010

Nice work man


Re: [INC] TearGas System - Scenario - 08.03.2010

This would come in handy for a S.W.A.T. team on "RP" servers.


Re: [INC] TearGas System - Carlton - 08.03.2010

Quote:
Originally Posted by ikarus
Nice work man
Quote:
Originally Posted by Oxside
Cool system usefull for roleplay servers/scripts
Thanks.


Re: [INC] TearGas System - Carlton - 10.03.2010

Sorry everyone who had downloaded it, or is using it. If you haven't noticed the bug I forgot to fix about the animation freezing when tear-gas using. It had froze the player after a animation, I re-read the parameters for the function ApplyAnimation, and noticed I forgot to change something. Please re-download.


Re: [INC] TearGas System - tackleza - 10.03.2010

Thank


Re: [INC] TearGas System - swat853 - 18.03.2010

Nice Work


Re: [INC] TearGas System - sushihusi - 19.03.2010

Thanks I will use it in my CS mod
Well done