Error 021: symbol already defined: "OnPlayerTakeDamage"
#1

I dont know why, the error is on the bracket line.

PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
// This one 
Код:
a.tmp(90306): error 021: symbol already defined: "OnPlayerTakeDamage"
*Note: I used SKY plugin and weapon-config include.

I'm Newbie in scripting. So Please help.
Reply
#2

check your script you have used Onplayertakedmage 2 times remove 1 to fix it
Reply
#3

Change OnPlayerTakeDamage with:

PHP код:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart
Reply
#4

it looks like u're using OnPlayerTakeDamage<-- 2 times.
just find another one and connect to ea.
than remove one of them.
Reply
#5

Quote:
Originally Posted by Mugalito
Посмотреть сообщение
it looks like u're using OnPlayerTakeDamage<-- 2 times.
just find another one and connect to ea.
than remove one of them.
He is not using it 2 times, i already told him the solution, check the reply above you
Reply
#6

Good. Now it has more error.
PHP код:
public OnPlayerTakeDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
// error 021
    
if(bodypart == 3PlayerInfo[playerid][pBodyStatus][0] -= frandom(1.0);
    if(
bodypart == 4PlayerInfo[playerid][pBodyStatus][1] -= frandom(1.0);
    if(
bodypart == 5PlayerInfo[playerid][pBodyStatus][3] -= frandom(1.0);
    if(
bodypart == 6PlayerInfo[playerid][pBodyStatus][2] -= frandom(1.0);
    if(
bodypart == 7PlayerInfo[playerid][pBodyStatus][5] -= frandom(1.0);
    if(
bodypart == 8PlayerInfo[playerid][pBodyStatus][4] -= frandom(1.0);
    
ShowBloodScreen(playeridamount);
    new 
status[64], Float:healthFloat:armorstring[128];
    
GetPlayerHealth(playeridhealth);
    
GetPlayerArmour(playeridarmor);
    
format(statussizeof(status), "Stranger_%d\n{ff0000}H: %.1f\n{ffffff}A: %.1f"RandMask[playerid], healtharmor);
    
UpdateDynamic3DTextLabelText(MaskText[playerid], 0xFFFFFFFFstatus);
    if(
issuerid != INVALID_PLAYER_ID && weaponid == 31 && bodypart == 9//error 017
    
{
        if(!
PlayerInfo[playerid][pHS])
        {
            
PlayerInfo[playerid][pHS] = 1;
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
SetTimerEx("KillPlayer",2000,0,"i",playerid);
        }
    }
    if(
issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9//error 017
    
{
        if(!
PlayerInfo[playerid][pHS])
        {
            
PlayerInfo[playerid][pHS] = 1;
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
SetTimerEx("KillPlayer",2000,0,"i",playerid);
        }
    }
    if(
issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 9//error 017
    
{
        if(!
PlayerInfo[playerid][pHS])
        {
            
PlayerInfo[playerid][pHS] = 1;
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
SetTimerEx("KillPlayer",2000,0,"i",playerid);
        }
    }
    if(
issuerid != INVALID_PLAYER_ID && weaponid == 30 && bodypart == 9//error 017
    
{
        if(!
PlayerInfo[playerid][pHS])
        {
            
PlayerInfo[playerid][pHS] = 1;
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
SetTimerEx("KillPlayer",2000,0,"i",playerid);
        }
    }
    if(
issuerid != INVALID_PLAYER_ID && weaponid == 25 && bodypart == 9//error 017
    
{
        if(!
PlayerInfo[playerid][pHS])
        {
            
PlayerInfo[playerid][pHS] = 1;
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
SetTimerEx("KillPlayer",2000,0,"i",playerid);
        }
    }
    if(
issuerid != INVALID_PLAYER_ID && weaponid == 27 && bodypart == 9//error 017
    
{
        if(!
PlayerInfo[playerid][pHS])
        {
            
PlayerInfo[playerid][pHS] = 1;
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
SetTimerEx("KillPlayer",2000,0,"i",playerid);
        }
    }
    if(
issuerid != INVALID_PLAYER_ID && bodypart == 7)
    {
        if(!
PlayerInfo[playerid][pLLS])
        {
            
PlayerInfo[playerid][pLLS] = 1;
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
ApplyAnimation(playerid,"CRACK""crckdeth2"4.11001600);
        }
    }
    if(
issuerid != INVALID_PLAYER_ID && bodypart == 8)
    {
        if(!
PlayerInfo[playerid][pRLS])
        {
            
PlayerInfo[playerid][pRLS] = 1;
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
ApplyAnimation(playerid,"CRACK""crckdeth2"4.11001600);
        }
    }
    if(
issuerid != INVALID_PLAYER_ID && bodypart == 5)
    {
        if(!
PlayerInfo[playerid][pLAS])
        {
            
PlayerInfo[playerid][pLAS] = 1;
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
    }
    if(
issuerid != INVALID_PLAYER_ID && bodypart == 6)
    {
        if(!
PlayerInfo[playerid][pRAS])
        {
            
PlayerInfo[playerid][pRAS] = 1;
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
    }
    if(
issuerid != INVALID_PLAYER_ID && bodypart == 4)
    {
        if(!
PlayerInfo[playerid][pCS])
        {
            if(
health 15)
            {
                
PlayerInfo[playerid][pCS] = 1;
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                
SetTimerEx("KillPlayer",3000,0,"i",playerid);
            }
        }
    }
    if(
issuerid != INVALID_PLAYER_ID && bodypart == 3)
    {
        if(!
PlayerInfo[playerid][pTS])
        {
            if(
health 15)
            {
                
PlayerInfo[playerid][pTS] = 1;
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                
SetTimerEx("KillPlayer",3000,0,"i",playerid);
            }
        }
    }
    return 
1;

Код:
a.TMP(90306) : error 021 : symbol already defined: "OnPlayerTakeDamage"
a.TMP(90321) : error 017 : undefined symbol "weaponid"
a.TMP(90330) : error 017 : undefined symbol "weaponid"
a.TMP(90339) : error 017 : undefined symbol "weaponid"
a.TMP(90348) : error 017 : undefined symbol "weaponid"
a.TMP(90357) : error 017 : undefined symbol "weaponid"
a.TMP(90366) : error 017 : undefined symbol "weaponid"
Reply
#7

First of all, the solution for weaponid, is actually called "weapon" in your function, so change that accordingly.
Reply
#8

Thanks, edyun, but it comes with a weird different error

PHP код:
new VehicleData[][VehicleDataEnum] = {
    {
"Admiral"445150000},
    {
"Alpha"602300000},
    {
"Ambulance"4165000000}, //line 5715, error 025
    
{"Andromada"59250000},
    {
"Article Trailer"59190000},
    {
"AT400"57750000},
    {
"Baggage"48550000},
    {
"Baggage Trailer A"60650000},
    {
"Baggage Trailer B"60750000},
    {
"Bandito"568500000},
    {
"Banshee"429200000},
    {
"Barracks"433420000},
    {
"Beagle"51150000},
    {
"Benson"499190000},
    {
"Berkley's RC Van"459230000},
    {
"BF Injection"424300000},
    {
"BF-400"581150000},
    {
"Bike"509500},
    {
"Blade"536300000},
    {
"Blista Compact"496150000},
    {
"Bloodring Banger"504300000},
    {
"BMX"4811000},
    {
"Bobcat"422160000},
    {
"Boxville 1"498120000},
    {
"Boxville 2"609120000},
    {
"Bravura"401200000},
    {
"Broadway"575260000},
    {
"Brownstreak (train)"53850000},
    {
"Buccaneer"518220000},
    {
"Buffalo"402300000},
    {
"Bullet"541500000},
    {
"Burrito"482250000},
    {
"Bus"43150000},
    {
"Cabbie"438200000},
    {
"Caddy"457100000},
    {
"Cadrona"527260000},
    {
"Camper"483280000},
    {
"Cargo Trailer"43590000},
    {
"Cargobob"5485000000},
    {
"Cement Truck"52450000},
    {
"Cheetah"415350000},
    {
"Clover"542150000},
    {
"Club"589300000},
    {
"Coach"43750000},
    {
"Coastguard"472500000},
    {
"Combine Harvester"53250000},
    {
"Comet"480400000},
    {
"Cropduster",512600000},
    {
"DFT-30"578400000},
    {
"Dinghy"473250000},
    {
"Dodo"593500000},
    {
"Dozer"48650000},
    {
"Dumper"40650000},
    {
"Dune"573500000},
    {
"Elegant"507200000},
    {
"Elegy"562350000},
    {
"Emperor"585200000},
    {
"Enforcer"42750000},
    {
"Esperanto"419150000},
    {
"Euros"587250000},
    {
"Faggio"46250000},
    {
"Farm Trailer"61050000},
    {
"FBI Rancher"4905000000},
    {
"FBI Truck"52850000},
    {
"FCR-900"521150000},
    {
"Feltzer"533150000},
    {
"Firetruck"40750000},
    {
"Firetruck LA"54450000},
    {
"Flash"565250000},
    {
"Flatbed"45550000},
    {
"Fluids Trailer"584100000},
    {
"Forklift"530200000},
    {
"Fortune"526150000},
    {
"Freeway"463180000},
    {
"Freight (train)"53750000},
    {
"Freight Box Trailer (train)"59050000},
    {
"Freight Flat Trailer (train)"56950000},
    {
"Glendale"466100000},
    {
"Glendale Shit"60450000},
    {
"Greenwood"492150000},
    {
"Hermes"474120000},
    {
"Hotdog"58850000},
    {
"Hotknife"434350000},
    {
"Hotring Racer 1"494500000},
    {
"Hotring Racer 2"502500000},
    {
"Hotring Racer 3"503500000},
    {
"HPV1000"52350000},
    {
"Hunter"425400000},
    {
"Huntley"579200000},
    {
"Hustler"545150000},
    {
"Hydra"52050000},
    {
"Infernus"411350000},
    {
"Intruder"546150000},
    {
"Jester"559250000},
    {
"Jetmax"493300000},
    {
"Journey"508200000},
    {
"Kart"571510000},
    {
"Landstalker"400300000},
    {
"Launch"595250000},
    {
"Leviathan"417350000},
    {
"Linerunner"403250000},
    {
"Majestic"517150000},
    {
"Manana"410160000},
    {
"Marquis"484200000},
    {
"Maverick"4871000000},
    {
"Merit"551250000},
    {
"Mesa"500300000},
    {
"Monster"4443000000},
    {
"Monster A"5563000000},
    {
"Monster B"5573000000},
    {
"Moonbeam"418200000},
    {
"Mountain Bike"5101100},
    {
"Mower"57260000},
    {
"Mr Whoopee"423110000},
    {
"Mule"414200000},
    {
"Nebula"516200000},
    {
"Nevada"553300000},
    {
"Newsvan"582230000},
    {
"NRG-500"522300000},
    {
"Oceanic"467150000},
    {
"Ore Trailer"45090000},
    {
"Packer"443150000},
    {
"Patriot"470300000},
    {
"PCJ-600"461200000},
    {
"Perenniel"404150000},
    {
"Phoenix"603300000},
    {
"Picador"600200000},
    {
"Pizzaboy"44870000},
    {
"Police Car (LSPD)"59650000},
    {
"Police Car (LVPD)"59850000},
    {
"Police Car (SFPD)"59750000},
    {
"Police Maverick"49750000},
    {
"Police Ranger"59950000},
    {
"Pony"413100000},
    {
"Predator"43050000},
    {
"Premier"426200000},
    {
"Previon"436150000},
    {
"Primo"547120000},
    {
"Quad"471200000},
    {
"Raindance"5631500000},
    {
"Rancher 1"489250000},
    {
"Rancher 2"505250000},
    {
"RC Bandit"44150000},
    {
"RC Baron"46450000},
    {
"RC Cam"59450000},
    {
"RC Goblin"50150000},
    {
"RC Raider"46550000},
    {
"RC Tiger"56450000},
    {
"Reefer"453200000},
    {
"Regina"479160000},
    {
"Remington"534200000},
    {
"Rhino"43250000},
    {
"Roadtrain"515500000},
    {
"Romero"442300000},
    {
"Rumpo"440150000},
    {
"Rustler"476350000},
    {
"Sabre"475250000},
    {
"Sadler"543250000},
    {
"Sadler Shit"60550000},
    {
"SAN News Maverick"4881500000},
    {
"Sanchez"468260000},
    {
"Sandking"4951000000},
    {
"Savanna"567200000},
    {
"Seasparrow"447540000},
    {
"Securicar"428350000},
    {
"Sentinel"405190000},
    {
"Shamal"5195000000},
    {
"Skimmer"4602000000},
    {
"Slamvan"535250000},
    {
"Solair"458300000},
    {
"Sparrow"469500000},
    {
"Speeder"452200000},
    {
"Squallo"446250000},
    {
"Stafford"580150000},
    {
"Stallion"439250000},
    {
"Stratum"561300000},
    {
"Streak Trailer (train)"57050000},
    {
"Stretch"4091400000},
    {
"Stuntplane"5131350000},
    {
"Sultan"560450000},
    {
"Sunrise"550250000},
    {
"Super GT"506300000},
    {
"S.W.A.T."60150000},
    {
"Sweeper"57450000},
    {
"Tahoma"566150000},
    {
"Tampa"549200000},
    {
"Tanker"514250000},
    {
"Taxi"420200000},
    {
"Tornado"576150000},
    {
"Towtruck"525300000},
    {
"Tractor"531250000},
    {
"Tram"44950000},
    {
"Trashmaster"40850000},
    {
"Tropic"454350000},
    {
"Tug"58350000},
    {
"Tug Stairs Trailer"60850000},
    {
"Turismo"451550000},
    {
"Uranus"558350000},
    {
"Utility Trailer"61150000},
    {
"Utility Van"55250000},
    {
"Vincent"540200000},
    {
"Virgo"491250000},
    {
"Voodoo"412160000},
    {
"Vortex"539500000},
    {
"Walton"478100000},
    {
"Washington"421200000},
    {
"Wayfarer"586200000},
    {
"Willard"529150000},
    {
"Windsor"555150000},
     {
"Yankee"456250000},
    {
"Yosemite"554350000},
    {
"ZR-350"477350000}
}; 
Код:
weapon-config.inc(5715) : error 025 : function heading differs from prototype
maybe i should open the include?
Reply
#9

Okay, if none can help me solve this problem, I will delete the SKY plugin and weapon-config include
(Removed them and script has no error.)
Reply
#10

Quote:
Originally Posted by Dirda
Посмотреть сообщение
Okay, if none can help me solve this problem, I will delete the SKY plugin and weapon-config include
(Removed them and script has no error.)
Bro you can keep it, this is what you need to do.

1. Download the latest version of weapon-config.

2. After that, put weapon-config.inc on your pawno/includes folder. Then, download SKY.dll or SKY.so and put it into your server/plugins

3. Include weapon-config on your script (#include <weapon-config>)

4. Add SKY.dll or SKY.so in your server.cfg at plugins

5. Open the script, use ctrl+f and search for OnPlayerTakeDamage

6. Replace OnPlayerTakeDamage with the code that you can find down there:

PHP код:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart
This is the way it works, i have faced this problem myself and this is the solution.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)