[Include] [INC] TearGas System
#1

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

Cool
Reply
#3

Quote:
Originally Posted by speedruntrainer
Cool
Thanks. :P
Reply
#4

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

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

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

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

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

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

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

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

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

Cool system usefull for roleplay servers/scripts
Reply
#14

Nice work man
Reply
#15

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

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

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

Thank
Reply
#19

Nice Work
Reply
#20

Thanks I will use it in my CS mod
Well done
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)