SA-MP Forums Archive
[FilterScript] Real Weapon Damage 1.1 - 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)
+--- Thread: [FilterScript] Real Weapon Damage 1.1 (/showthread.php?tid=213049)



Real Weapon Damage - .LaaRs. - 18.01.2011

Okay.
Im it again and i updated my Real Weapon Damage. [NO its to bugged]
btw. You need to have the Include OnPlayerShootPlayer...



Download:

version 1.0 : http://uploaded.to/file/c6b8td

Pastebin:

version 1.0 : http://pastebin.com/6aJH2PZc

I big thank you again at Double-O-Seven s
OnPlayerShootPlayer function.


Re: Real Weapon Damage 1.1 - Meinstad - 18.01.2011

Fail in code, but okey. 3/6


AW: Real Weapon Damage 1.1 - .LaaRs. - 18.01.2011

where is fail could you say it to me im new in scripting


Re: Real Weapon Damage 1.1 - SkizzoTrick - 18.01.2011

Nice,but your unorganised :P
It's ok anyway xD


Re: Real Weapon Damage 1.1 - Mauzen - 18.01.2011

The first problem I saw is this:

pawn Код:
if(GetPlayerWeapon(shooter) == 29 || 31 || 30)
You cannot compare it that way, pawn will read it like this:
pawn Код:
if(GetPlayerWeapon(shooter) == 29)
OR
if(31)
OR
if(30)
As 31/30 are not 0, pawn reads them as true, so this line will always be true.
You will have to do it this, change all matching ifs:

pawn Код:
if(GetPlayerWeapon(shooter) == 29 || GetPlayerWeapon(shooter) == 31 || GetPlayerWeapon(shooter) == 30)
Dont know if there are other mistakes, but this is the most fatal one, as the used weapon is not detected correctly.

But however, nice work. Tons of "pro scripters" dont manage it to create something like this, and whine in the request thread, but you as a beginner just made it on your own. Keep it up!


AW: Real Weapon Damage 1.1 - .LaaRs. - 18.01.2011

okay ty


Re: Real Weapon Damage 1.1 - Matz - 02.08.2011

pawn Код:
C:\Documents and Settings\Matz\Desktop\realhit.pwn(40) : error 025: function heading differs from prototype
C:\Documents and Settings\Matz\Desktop\realhit.pwn(43) : warning 219: local variable "armour" shadows a variable at a preceding level
C:\Documents and Settings\Matz\Desktop\realhit.pwn(45) : warning 219: local variable "health" shadows a variable at a preceding level
C:\Documents and Settings\Matz\Desktop\realhit.pwn(57) : warning 219: local variable "armour" shadows a variable at a preceding level
C:\Documents and Settings\Matz\Desktop\realhit.pwn(59) : warning 219: local variable "health" shadows a variable at a preceding level
C:\Documents and Settings\Matz\Desktop\realhit.pwn(69) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Matz\Desktop\realhit.pwn(70) : warning 219: local variable "armour" shadows a variable at a preceding level
C:\Documents and Settings\Matz\Desktop\realhit.pwn(72) : warning 219: local variable "health" shadows a variable at a preceding level
C:\Documents and Settings\Matz\Desktop\realhit.pwn(82) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Matz\Desktop\realhit.pwn(83) : warning 219: local variable "armour" shadows a variable at a preceding level
C:\Documents and Settings\Matz\Desktop\realhit.pwn(85) : warning 219: local variable "health" shadows a variable at a preceding level
C:\Documents and Settings\Matz\Desktop\realhit.pwn(95) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Matz\Desktop\realhit.pwn(96) : error 001: expected token: ")", but found "new"
C:\Documents and Settings\Matz\Desktop\realhit.pwn(96) : error 003: declaration of a local variable must appear in a compound block
C:\Documents and Settings\Matz\Desktop\realhit.pwn(96) : warning 221: label name "Float" shadows tag name
C:\Documents and Settings\Matz\Desktop\realhit.pwn(96) : error 017: undefined symbol "armour"
C:\Documents and Settings\Matz\Desktop\realhit.pwn(96) : fatal error 107: too many error messages on one line

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


8 Errors.
Btw It was 0.3b


Re: Real Weapon Damage 1.1 - andrew4699 - 02.08.2011

Matz you should really fix shit on your own instead of having people do it for you. That's the easiest shit I've seen to fix.


Re: Real Weapon Damage 1.1 - Julio Turios - 02.08.2011

Help me:

Код:
error 025: function heading differs from prototype
Код:
public OnPlayerShootPlayer(shooter,target,Float:damage)



Respuesta: Re: Real Weapon Damage 1.1 - matimutter - 30.08.2011

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
The first problem I saw is this:

pawn Код:
if(GetPlayerWeapon(shooter) == 29 || 31 || 30)
You cannot compare it that way, pawn will read it like this:
pawn Код:
if(GetPlayerWeapon(shooter) == 29)
OR
if(31)
OR
if(30)
As 31/30 are not 0, pawn reads them as true, so this line will always be true.
You will have to do it this, change all matching ifs:

pawn Код:
if(GetPlayerWeapon(shooter) == 29 || GetPlayerWeapon(shooter) == 31 || GetPlayerWeapon(shooter) == 30)
Dont know if there are other mistakes, but this is the most fatal one, as the used weapon is not detected correctly.

But however, nice work. Tons of "pro scripters" dont manage it to create something like this, and whine in the request thread, but you as a beginner just made it on your own. Keep it up!
[/quote]The first problem I saw is this:

pawn Cуdigo:

if(GetPlayerWeapon(shooter) == 29 || 31 || 30)


You cannot compare it that way, pawn will read it like this:
pawn Cуdigo:

if(GetPlayerWeapon(shooter) == 29)
OR
if(31)
OR
if(30)[/quote]

that is C# code, || => that is the "or" operator, i think thats fine...