16.04.2011, 02:38
Im fairly new to scripting but im helping a mate develop some stuff for a rp server we run
anyway i got this code and it redefines the weapon damages in a script its not a filterscript its actually part of the game mode itself to stop exploits
but i get some errors and i cant see where help please?
Code -
#include <a_samp>
#include <Zcmd>
#include <Sscanf2>
forward OnPlayerShootPlayer(Shooter, Target, Float:Healthlost, Float:Armourlost);
public OnPlayerShootPlayer(Shooter, Target, Float:Healthlost, Float:Armourlost);
{
new Float:H[2]
if(GetPlayerWeapon(Shooter) == 34) //Sniper
{
GetPlayerHealth(Target, H[0]);
GetPlayerArmour(Target,H[1]);
{
if(H[1] > 0) return SetPlayerArmour(Target, 1);
SetPlayerHealth(Target, H[0]-30);
SetPlayerArmour(Target, H[1]-100);
}
else
}
if(H[1] == 0) return SetPlayerArmour(Target, 0);
SetPlayerHealth(Target, H[0]-70);
}
return 1;
}
errors -
C:\Users\pedro\Desktop\pawno\weapon damages.pwn(7) : error 055: start of function body without function header
C:\Users\pedro\Desktop\pawno\weapon damages.pwn(9) : error 001: expected token: ";", but found "if"
C:\Users\pedro\Desktop\pawno\weapon damages.pwn(14) : error 010: invalid function or declaration
C:\Users\pedro\Desktop\pawno\weapon damages.pwn(1
: error 010: invalid function or declaration
C:\Users\pedro\Desktop\pawno\weapon damages.pwn(20) : error 010: invalid function or declaration
C:\Users\pedro\Desktop\pawno\weapon damages.pwn(23) : error 010: invalid function or declaration
C:\Users\pedro\Desktop\pawno\weapon damages.pwn(25) : warning 203: symbol is never used: "H"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
6 Errors.
No tutorial was used to make this i tried it from scratch
anyway i got this code and it redefines the weapon damages in a script its not a filterscript its actually part of the game mode itself to stop exploits
but i get some errors and i cant see where help please?
Code -
#include <a_samp>
#include <Zcmd>
#include <Sscanf2>
forward OnPlayerShootPlayer(Shooter, Target, Float:Healthlost, Float:Armourlost);
public OnPlayerShootPlayer(Shooter, Target, Float:Healthlost, Float:Armourlost);
{
new Float:H[2]
if(GetPlayerWeapon(Shooter) == 34) //Sniper
{
GetPlayerHealth(Target, H[0]);
GetPlayerArmour(Target,H[1]);
{
if(H[1] > 0) return SetPlayerArmour(Target, 1);
SetPlayerHealth(Target, H[0]-30);
SetPlayerArmour(Target, H[1]-100);
}
else
}
if(H[1] == 0) return SetPlayerArmour(Target, 0);
SetPlayerHealth(Target, H[0]-70);
}
return 1;
}
errors -
C:\Users\pedro\Desktop\pawno\weapon damages.pwn(7) : error 055: start of function body without function header
C:\Users\pedro\Desktop\pawno\weapon damages.pwn(9) : error 001: expected token: ";", but found "if"
C:\Users\pedro\Desktop\pawno\weapon damages.pwn(14) : error 010: invalid function or declaration
C:\Users\pedro\Desktop\pawno\weapon damages.pwn(1

C:\Users\pedro\Desktop\pawno\weapon damages.pwn(20) : error 010: invalid function or declaration
C:\Users\pedro\Desktop\pawno\weapon damages.pwn(23) : error 010: invalid function or declaration
C:\Users\pedro\Desktop\pawno\weapon damages.pwn(25) : warning 203: symbol is never used: "H"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
6 Errors.
No tutorial was used to make this i tried it from scratch