[FilterScript] Exploding Bullets for Country Rifle (0.3d)
#1

Hi,
This is my first script. Insanely simple and small thanks to OnPlayerGiveDamage.
I took the opportunity to make the Country Rifle a lot more powerful and fun by making the bullets explode.

Sorry about the poor video quality, but you will get the idea.

http://*********/qxGi8tn0Ks0

PHP Code:
// Explosive ammo for country rifle by Klabauter_Mann
// Please do not remove the credits or claim this script as your own
// You must use SA:MP 0.3d Pawno to compile this script
// Only for SA:MP 0.3d servers
#include <a_samp>
public OnFilterScriptInit()
{
    print(
"\n-------------------------------------------------");
    print(
" Explosive ammo for country rifle by Klabauter_Mann");
    print(
"-------------------------------------------------\n");
    return 
true;
}
public 
OnPlayerConnect(playerid)
{
    
SendClientMessage(playerid0xC071FFFF"This server is using Explosive Country Rifle Ammo");
    
SendClientMessage(playerid0xC071FFFF"Made by Klabauter_Mann");
    return 
true;
}
public 
OnPlayerGiveDamage(playeriddamagedidFloatamountweaponid)
{
    if(
GetPlayerWeapon(playerid) == 33)
    {
        
incindiary(damagedid);
    }
    return 
true;
}
stock incindiary(playerid)
{
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    return 
CreateExplosion(xyz121);

Thanks Riddick94

I took your advice and updated the script.

BIG update Feb. 20, 2014: ROFL i can't help but add the 0.3z version
PHP Code:
#include <a_samp>
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    if(!
IsPlayerConnected(playerid)) return 0;
    if(
weaponid == 33)
    {
    new 
Float:fOriginXFloat:fOriginYFloat:fOriginZFloat:fHitPosXFloat:fHitPosYFloat:fHitPosZ;
    
GetPlayerLastShotVectors(playeridfOriginXfOriginYfOriginZfHitPosXfHitPosYfHitPosZ);
    
CreateExplosion(fHitPosXfHitPosYfHitPosZ121);
    }
    return 
1;

Reply
#2

Good idea Keep it up :d
Reply
#3

Very nice !!! I'll do it for all weapons

+1 rep!
Reply
#4

Very awsome good job +1 for idea
Reply
#5

Some lines and code are not needed:

pawn Code:
// Explosive ammo for country rifle by Klabauter_Mann
// Please do not remove the credits or claim this script as your own
// You must use SA:MP 0.3d Pawno to compile this script
// Only for SA:MP 0.3d servers
#include <a_samp>

public OnFilterScriptInit()
{
    print("\n-------------------------------------------------");
    print(" Explosive ammo for country rifle by Klabauter_Mann");
    print("-------------------------------------------------\n");
    return true;
}

public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, 0xC071FFFF, "This server is using Explosive Country Rifle Ammo");
    SendClientMessage(playerid, 0xC071FFFF, "Made by Klabauter_Mann");
    return true;
}

public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    if(GetPlayerWeapon(playerid) == 33)
    {
        incindiary(damagedid);
    }
    return true;
}

stock incindiary(playerid)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    return CreateExplosion(x, y, z, 12, 1);
}
Reply
#6

How to kill yourself, use this.

EDIT: means that the code fails.
Reply
#7

Quote:
Originally Posted by Lorenc_
View Post
How to kill yourself, use this.
+1

@author: Learn how float values and CreateExplosion Works.

Have you even tested the code ?
Reply
#8

Code looks fine? What are you guys getting at.
Reply
#9

Quote:
Originally Posted by PrawkC
View Post
Code looks fine? What are you guys getting at.
See the CODE properly.
Reply
#10

Quote:
Originally Posted by XFlawless
View Post
+1

Have you even tested the code ?
LooooooooL he has tested the script thats why he made a video lol :P

@author hmm since it use OnPlayerGiveDamage thats why explosion occur only when it touches the character ,

I am not sure if it gonna wrk with LagShot?
btw nice idea
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)