Aeon Trag Posted August 6, 2009 Author Share Posted August 6, 2009 I have file named weapons.ini created. It includes…..[12]WepATK = 5WepDEF = 1WepName = Rusty KnifeNow, the rusty knife is itemnum 12…. How do I get the Item number of the weapons slot? is it something like this?Itm = GetPlayerWeapomSlot(Index, GetItemNum(index))also how would i difine that number drawing on my .ini? such as....WepAtk = GetVar("Weapons.ini", "Itm", "WepATK")Itm above represents the number drawn by the first definition...need to get the item number from the weapons slot to the defined number of the ini file and draw from it the weapons attack.Thanks Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 6, 2009 Share Posted August 6, 2009 @ 1st question : it is Int(GetPlayerInvItemNum(index , Int(GetPlayerWeaponSlot(index))))@ second you can do something like thisDim ItemNumDim WepAtkItemNum = Int(GetPlayerInvItemNum(index , Int(GetPlayerWeaponSlot(index))))WepAtk = Int(GetVar("Weapons.ini" , ""& ItemNum , "WepATK")) Link to comment Share on other sites More sharing options...
Aeon Trag Posted August 6, 2009 Author Share Posted August 6, 2009 That could be, Im new to this….Ill try it Link to comment Share on other sites More sharing options...
Aeon Trag Posted August 6, 2009 Author Share Posted August 6, 2009 Here's What I have, Doesn't work if someone could tell me whts wrong with it I'd appreciate it.```' Executes when a player presses the CONTROL key.Sub OnAttack(Index, Damage)Dim TargetDim ItmDim WepAtkDim StrDim MaxDim MinDim AvgDim LowAvgDim HiAvgDim Hit Itm = Int(GetPlayerInvItemNum(index , Int(GetPlayerWeaponSlot(index)))) WepAtk = GetVar("Weapons.ini", "" & Itm & "", "WepATK") Str = GetPlayerSTR(Index) /2 Max = (WepAtk, Str) *3 Min = 1 Avg = (WepAtk, Str) LowAvg = (WepAtk, Str) /2 HiAvg = (WepAtk, Str) *2 Hit = Rand(1, 6) If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, Rand(1, Max)) End If Else Target = GetPlayerTargetNPC(Index) If Hit = 1 Then Call DamageNPC(Index, Target, Rand(1, Str)) End If If Hit = 2 Then Call DamageNPC(Index, Target, Rand(1, Str)) End If If Hit = 3 Then Call DamageNPC(Index, Target, Rand(LowAvg, Avg)) End If If Hit = 4 Then Call DamageNPC(Index, Target, Rand(LowAvg, HiAvg)) End If If Hit = 5 Then Call DamageNPC(Index, Target, Rand(Avg, HiAvg)) End If If Hit = 6 Then Call DamageNPC(Index, Target, Rand(HiAvg, Max)) End IfEnd Sub```Thanks for the help Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 6, 2009 Share Posted August 6, 2009 ```' Executes when a player presses the CONTROL key.Sub OnAttack(Index, Damage)Dim TargetDim ItmDim WepAtkDim StrDim MaxDim MinDim AvgDim LowAvgDim HiAvgDim Hit Itm = Int(GetPlayerInvItemNum(index , Int(GetPlayerWeaponSlot(index)))) WepAtk = GetVar("Weapons.ini", "" & Itm , "WepATK") Str = GetPlayerSTR(Index) /2 Max = (WepAtk, Str) *3 Min = 1 Avg = (WepAtk, Str) LowAvg = (WepAtk, Str) /2 HiAvg = (WepAtk, Str) *2 Hit = Rand(1, 6) If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, Rand(1, Max)) End If Else Target = GetPlayerTargetNPC(Index) If Hit = 1 Then Call DamageNPC(Index, Target, Rand(1, Str)) End If If Hit = 2 Then Call DamageNPC(Index, Target, Rand(1, Str)) End If If Hit = 3 Then Call DamageNPC(Index, Target, Rand(LowAvg, Avg)) End If If Hit = 4 Then Call DamageNPC(Index, Target, Rand(LowAvg, HiAvg)) End If If Hit = 5 Then Call DamageNPC(Index, Target, Rand(Avg, HiAvg)) End If If Hit = 6 Then Call DamageNPC(Index, Target, Rand(HiAvg, Max)) End IfEnd Sub```try now Link to comment Share on other sites More sharing options...
Aeon Trag Posted August 6, 2009 Author Share Posted August 6, 2009 Still nothin Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 6, 2009 Share Posted August 6, 2009 lol..```' Executes when a player presses the CONTROL key.Sub OnAttack(Index, Damage)Dim TargetDim ItmDim WepAtkDim StrDim MaxDim MinDim AvgDim LowAvgDim HiAvgDim Hit Itm = Int(GetPlayerInvItemNum(index , Int(GetPlayerWeaponSlot(index)))) WepAtk = GetVar("Weapons.ini", "" & Itm , "WepATK") Str = GetPlayerSTR(Index) / 2 Max = (WepAtk, Str) * 3 Min = 1 Avg = (WepAtk, Str) LowAvg = (WepAtk, Str) / 2 HiAvg = (WepAtk, Str) * 2 Hit = Rand(1, 6) If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, Rand(1, Max)) End If Else Target = GetPlayerTargetNPC(Index) If Hit = 1 Then Call DamageNPC(Index, Target, Rand(1, Str)) End If If Hit = 2 Then Call DamageNPC(Index, Target, Rand(1, Str)) End If If Hit = 3 Then Call DamageNPC(Index, Target, Rand(LowAvg, Avg)) End If If Hit = 4 Then Call DamageNPC(Index, Target, Rand(LowAvg, HiAvg)) End If If Hit = 5 Then Call DamageNPC(Index, Target, Rand(Avg, HiAvg)) End If If Hit = 6 Then Call DamageNPC(Index, Target, Rand(HiAvg, Max)) End IfEnd Sub```try now² Link to comment Share on other sites More sharing options...
Aeon Trag Posted August 6, 2009 Author Share Posted August 6, 2009 Nope :huh: Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 6, 2009 Share Posted August 6, 2009 Whats the error? Link to comment Share on other sites More sharing options...
Aeon Trag Posted August 6, 2009 Author Share Posted August 6, 2009 Type: Expected )Line: 15Column: 13Code: Max = (WepAtk, Str) * 3 Link to comment Share on other sites More sharing options...
Aeon Trag Posted August 6, 2009 Author Share Posted August 6, 2009 In Game I get this error…..Type: Type mismatch: 'OnAttack' Link to comment Share on other sites More sharing options...
Bobosk Posted August 6, 2009 Share Posted August 6, 2009 ```' Executes when a player presses the CONTROL key.Sub OnAttack(Index, Damage)Dim TargetDim ItmDim WepAtkDim StrDim MaxDim MinDim AvgDim LowAvgDim HiAvgDim Hit Itm = Int(GetPlayerInvItemNum(index , Int(GetPlayerWeaponSlot(index)))) WepAtk = GetVar("Weapons.ini", "" & Itm , "WepATK") Str = GetPlayerSTR(Index) / 2 Max = (WepAtk + Str) * 3 Min = 1 Avg = (WepAtk + Str) LowAvg = (WepAtk + Str) / 2 HiAvg = (WepAtk + Str) * 2 Hit = Rand(1, 6) If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, Rand(1, Max)) Else Target = GetPlayerTargetNPC(Index) End If If Hit = 1 Then Call DamageNPC(Index, Target, Rand(1, Str)) End If If Hit = 2 Then Call DamageNPC(Index, Target, Rand(1, Str)) End If If Hit = 3 Then Call DamageNPC(Index, Target, Rand(LowAvg, Avg)) End If If Hit = 4 Then Call DamageNPC(Index, Target, Rand(LowAvg, HiAvg)) End If If Hit = 5 Then Call DamageNPC(Index, Target, Rand(Avg, HiAvg)) End If If Hit = 6 Then Call DamageNPC(Index, Target, Rand(HiAvg, Max)) End IfEnd Sub```Try that Link to comment Share on other sites More sharing options...
Aeon Trag Posted August 6, 2009 Author Share Posted August 6, 2009 Lmao…...Stupid mistake +++++++Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now