Need help with filterscript
#1

Hi,
I need help with this filterscript: http://pastebin.com/r3QDy612
It's supposed to be custom damage for M4, AK-47 and MP5, but I can't compile it.
Here are the errors:

Quote:

C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(34) : error 036: empty statement
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(47) : warning 217: loose indentation
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(47) : error 014: invalid statement; not in switch
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(47) : warning 215: expression has no effect
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(47) : error 001: expected token: ";", but found ":"
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(47) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(47) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (coffee) 1997-2006, ITB CompuPhase

5 Errors

Could someone fix that for me? Also I'm not sure if it will take armor. If not then can someone make it like that if player has armor it takes that much damage that is stated in the script and if armor reaches 0 or player has no armor it takes health.
I'd really appreciate that because I don't know how to script, but I need this.
Reply
#2

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
Hi,
I need help with this filterscript: http://pastebin.com/r3QDy612
It's supposed to be custom damage for M4, AK-47 and MP5, but I can't compile it.
Here are the errors:



Could someone fix that for me? Also I'm not sure if it will take armor. If not then can someone make it like that if player has armor it takes that much damage that is stated in the script and if armor reaches 0 or player has no armor it takes health.
I'd really appreciate that because I don't know how to script, but I need this.
Here you go http://pastebin.com/1HZdvmBx
Reply
#3

Seems like it doesn't take the damages stated in the filterscript. It takes damages that are in the gamemode, but I don't know where. I think it's conflicting with the gamemode.
I'm using South Central Roleplay 0.21. Help?
Reply
#4

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
Seems like it doesn't take the damages stated in the filterscript. It takes damages that are in the gamemode, but I don't know where. I think it's conflicting with the gamemode.
I'm using South Central Roleplay 0.21. Help?
i could give u mine OnPlayerTakeDamage if you want?
Reply
#5

Yes pls
Reply
#6

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
Yes pls
Here you go

Put this top of your script

PHP код:
#define DAMAGE_COLT 35
#define DAMAGE_SILENCER 35
#define DAMAGE_DEAGLE 50
#define DAMAGE_SHOTGUN 40
#define DAMAGE_SAWNOFF 35
#define DAMAGE_UZI 35
#define DAMAGE_MP5 35
#define DAMAGE_AK47 35
#define DAMAGE_RIFLE 40
#define DAMAGE_TEC9 35
#define DAMAGE_M4 45
#define DAMAGE_SNIPER 155 
Put this under your OnPlayerTakeDamage
PHP код:
}
    new 
damage 0;
    switch(
weaponid)
    {
         case 
22damage DAMAGE_COLT;
           case 
23damage DAMAGE_SILENCER;
        case 
24damage DAMAGE_DEAGLE;
        case 
25damage DAMAGE_SHOTGUN;
        case 
26damage DAMAGE_SAWNOFF;
        case 
28damage DAMAGE_UZI;
        case 
29damage DAMAGE_MP5;
        case 
30damage DAMAGE_AK47;
        case 
31damage DAMAGE_M4;
        case 
32damage DAMAGE_TEC9;
        case 
33damage DAMAGE_RIFLE;
        case 
34damage DAMAGE_SNIPER;
    }
    if(
damage != && !IsPlayerInRangeOfPoint(issuerid,distance,x,y,z))
    {
         if(
armour 0)
           {
             
amoun armour damage;
            if(
amoun 0) return SetPlayerHealth(playerid,health-damage);
            return 
SetPlayerArmour(playerid,armour-damage);
        }
        else return 
SetPlayerHealth(playerid,health-damage);
    }
    return 
true;

Reply
#7

Uh, but how can I make like that M4/AK-47 would take 20 health/armor per shot. I don't understand anything what will this thing do Will it deal double of the default damage or what?
Reply
#8

Just define
Код:
#define DAMAGE_M4 20
Reply
#9

N0FeaR's script: http://pastebin.com/Ytq0whe9
Errors:
Код:
 C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(22) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(22 -- 23) : warning 215: expression has no effect
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(23) : error 001: expected token: ";", but found "new"
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(24) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(26) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(27) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(28) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(29) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(30) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(31) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(32) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(33) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(34) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(35) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(36) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(37) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(39) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(41) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(44) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(45) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(47) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(49) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(53) : warning 203: symbol is never used: "damage"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


21 Errors.
Help? :/
Reply
#10

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
N0FeaR's script: http://pastebin.com/Ytq0whe9
Errors:
Код:
 C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(22) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(22 -- 23) : warning 215: expression has no effect
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(23) : error 001: expected token: ";", but found "new"
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(24) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(26) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(27) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(28) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(29) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(30) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(31) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(32) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(33) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(34) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(35) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(36) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(37) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(39) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(41) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(44) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(45) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(47) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(49) : error 010: invalid function or declaration
C:\Users\User\Desktop\Los Santos Life Roleplay\RealisticDamages.pwn(53) : warning 203: symbol is never used: "damage"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


21 Errors.
Help? :/
You doing something wrong, works for me without errors.

give me ur whole OnPlayerTakeDamage

EDIT: here you go http://pastebin.com/a0Y08R7d
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)