OnPlayerTakeDamage
#1

I want the script to change bullet damage by weapon and variable enabled,but it won't work.

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(StrategyArmy == 1)
{
    new Float: health;
    GetPlayerHealth(playerid,health);
    switch(weaponid)
    {
        case 31: SetPlayerHealth(playerid,health-30);
        case 24: SetPlayerHealth(playerid,health-30);
        case 35: SetPlayerHealth(playerid,health-40);
    }
    if(StrategyArmy == 2)
    {
    new Float: health;
    GetPlayerHealth(playerid,health);
    switch(weaponid)
    {
        case 34: SetPlayerHealth(playerid,health-60);
        case 25: SetPlayerHealth(playerid,health-30);
        case 16: SetPlayerHealth(playerid,health-70);
    }
    if(StrategyTerror == 1)
    {
    new Float: health;
    GetPlayerHealth(playerid,health);
    switch(weaponid)
    {
        case 31: SetPlayerHealth(playerid,health-30);
        case 24: SetPlayerHealth(playerid,health-30);
        case 35: SetPlayerHealth(playerid,health-40);
    }
    if(StrategyTerror == 2)
    {
    new Float: health;
    GetPlayerHealth(playerid,health);
    switch(weaponid)
    {
        case 34: SetPlayerHealth(playerid,health-60);
        case 25: SetPlayerHealth(playerid,health-30);
        case 16: SetPlayerHealth(playerid,health-70);
    }
    if(issuerid != INVALID_PLAYER_ID && weaponid == 4)
    {
         //One shot to kill with knife
        SetPlayerHealth(playerid, 0.0);
   }
return 1;
}
Код:
C:\Users\Tamer\Desktop\pwn\AVT scripting\gamemodes\GameMode.pwn(7753) : warning 219: local variable "health" shadows a variable at a preceding level
C:\Users\Tamer\Desktop\pwn\AVT scripting\gamemodes\GameMode.pwn(7763) : warning 219: local variable "health" shadows a variable at a preceding level
C:\Users\Tamer\Desktop\pwn\AVT scripting\gamemodes\GameMode.pwn(7773) : warning 219: local variable "health" shadows a variable at a preceding level
C:\Users\Tamer\Desktop\pwn\AVT scripting\gamemodes\GameMode.pwn(7786) : warning 217: loose indentation
C:\Users\Tamer\Desktop\pwn\AVT scripting\gamemodes\GameMode.pwn(7805) : error 030: compound statement not closed at the end of file (started at line 7763)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Messages In This Thread
OnPlayerTakeDamage - by Tamer - 12.01.2013, 18:30
Re: OnPlayerTakeDamage - by ThePhenix - 12.01.2013, 18:41
Re: OnPlayerTakeDamage - by zSuYaNw - 12.01.2013, 18:43

Forum Jump:


Users browsing this thread: 1 Guest(s)