shadowwulf Posted October 8, 2008 Author Share Posted October 8, 2008 I made a function and compiled it. it gave the error "Variable not defined"and points out Index…```ArmorSlot = GetPlayerArmorSlot(Index)```now this is done in the function right before it and works fine.any idea? Link to comment Share on other sites More sharing options...
sir zach Posted October 8, 2008 Share Posted October 8, 2008 Dim ArmorSlotIDK but that's my guess. Link to comment Share on other sites More sharing options...
shadowwulf Posted October 8, 2008 Author Share Posted October 8, 2008 nope. dim'ed it first and still got it. Link to comment Share on other sites More sharing options...
sir zach Posted October 8, 2008 Share Posted October 8, 2008 ~~No idea then. Sorry. Maybe someone else can help.~~Oh, Index isn't defined. It doesn't know a value to put in for Index. Link to comment Share on other sites More sharing options...
Robin Posted October 8, 2008 Share Posted October 8, 2008 In the function byvals, add index, then make sure you add it to the function call.```FunctionName(byval index as long)``` Link to comment Share on other sites More sharing options...
Tyr Posted October 11, 2008 Share Posted October 11, 2008 ye, its what robin says. normally index is defined in almost every sub automaticly. it supprised me that its not in here :) Link to comment Share on other sites More sharing options...
shadowwulf Posted October 11, 2008 Author Share Posted October 11, 2008 yeah it simply didnt put subname(index, p1,p2) Link to comment Share on other sites More sharing options...
Tyr Posted October 11, 2008 Share Posted October 11, 2008 :) problem solved. Link to comment Share on other sites More sharing options...
cheatking Posted October 11, 2008 Share Posted October 11, 2008 Or change index to myindex …Index is used in sad script. But for source myindex is used :) Link to comment Share on other sites More sharing options...
shadowwulf Posted October 11, 2008 Author Share Posted October 11, 2008 i havent seen myindex once in all of the EE source…. Link to comment Share on other sites More sharing options...
cheatking Posted October 11, 2008 Share Posted October 11, 2008 frmNewShop.Buyback GetPlayerInvItemNum(MyIndex, Inventory), Inventory–An example :) Use search and you will find plenty. Link to comment Share on other sites More sharing options...
shadowwulf Posted October 12, 2008 Author Share Posted October 12, 2008 hmm. i was basically following the method of all the other usbs/functions i saw.that looks like its from a form…I will be looking into it in a couple minutes, you sure its not just for forms?EE 2.7 server, no instance of myindex located. Link to comment Share on other sites More sharing options...
cheatking Posted October 12, 2008 Share Posted October 12, 2008 Wel it works:) I used it for player guilds. Instead of inputtig player name it uses GetPlayerName(MyIndex) - Something like that. Link to comment Share on other sites More sharing options...
gizmo1 Posted October 13, 2008 Share Posted October 13, 2008 this could also work :cheesy::replace Function Getplayername with this :```Function GetPlayerName(ByVal index As Long) As String Dim P1 Dim P2 GetPlayerName = Trim$(Player(index).Char(Player(index).CharNum).Name) P1 = GetPlayerName(index) P2 = GetPlayerTarget(index)End Function```ok now you've unlocked 2 commands :P```Call GetPlayerName(P1) 'this is player oneCall GetPlayerName(P2) ' this is player 2```if it doesn't work just tell me :P. Link to comment Share on other sites More sharing options...
drunk_on_cheese Posted October 13, 2008 Share Posted October 13, 2008 MyIndex = Your Player's Game Number ( The socket number of your player )Index = Used for getting a certain Player(s) number like:For x = 0 to InsertMaxPlayers DrawPlayerName(x, GetPlayerName(x) )Next xWhich would Draw All the Players Name or whatever Link to comment Share on other sites More sharing options...
gizmo1 Posted October 13, 2008 Share Posted October 13, 2008 yeah or you can do this lol:```Dim TargetpTargetp = GetPlayerTarget(Index)Call PutVar("Duelists\" & GetPlayerName(Targetp) & ".ini", "Party", "User2", GetPlayerName(Index))Call PutVar("Duelists\" & GetPlayerName(Targetp) & ".ini", "Party", "User2-id", Int(Index))Call PutVar("Duelists\" & GetPlayerName(Targetp) & ".ini", "Party", "User1", GetPlayerName(Targetp))Call PutVar("Duelists\" & GetPlayerName(Targetp) & ".ini", "Party", "User1-id", Int(Targetp))Call PutVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User2-id", Int(Index))Call PutVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User2", GetPlayerName(Index))Call PutVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1", GetPlayerName(Targetp))Call PutVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1-id", Int(Targetp))Call PutVar("Duelists\" & GetPlayerName(Targetp) & ".ini", "Party", "Party", "Yes")Call PutVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "Party", "Yes")'Dim P1'Dim P2'P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")'P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")```need a bit more but yours is shorter and better franky :). Link to comment Share on other sites More sharing options...
shadowwulf Posted October 13, 2008 Author Share Posted October 13, 2008 "GetPlayerTarget(Index)" works for scripting, not for source.This problem was resolved so i will lock it but thanks to everyone that helped. 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