Sealbreaker Posted August 27, 2009 Author Share Posted August 27, 2009 yeah…the name says everything... pls dont say things like: dont try it man or somethin like this <.<so, here is my script and i dont know why it doesnt work....``` Case "/summonpet" DIM playerx DIM playery DIM playermap DIM npconmap+1 DIM npconmap DIM playertarget DIM playermp DIM petnumber DIM petsnumber+1 DIM petsnumber DIM petdef DIM petstr DIM petmaxhp DIM pethp DIM petmapnumber playerx = GetPlayerX(index) playery = GetPlayerY(index) playermap = GetPlayerMap(index) npconmap+1 = GetMapNpcNumber(GetPlayerMap(index), index) + 1) npconmap = GetMapNpcNumber(GetPlayerMap(index), index) playertarget = GetPlayerTargetNpc(index) playermp = GetPlayerMP(index) - 20) petnumber = GetVar(GetPlayerName(index) & ".ini", "PET", "petnumber") petsnumber+1 = GetVar("Data.ini", "PETS", "petsnumber") + 1) petsnumber = GetVar("Data.ini", "PETS", "petsnumber") petdef = GetNpcDefense(petnumber) petstr = GetNpcStrength(petnumber) petmaxhp = GetNpcMaxHP(index) pethp = GetNpcHP(petnumber) petmapnumber = GetVar(GetPlayerName(index) & ".ini", "PET", "petmapnumber") If GetVar(GetPlayerName(index) & ".ini", "PET", "activatedbefore", 0) Then If GetVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 0) Then Call PutVar(GetPlayerName(index) & ".ini", "PET", "petnumber", petsnumber+1) Call PutVar("Data.ini", "PETS", "petsnumbers", petsnumber+1) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petdef", 40) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petstr", 35) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petexp", 10) Call ScriptSpawnNpc(npconmap+1, playermap, playerx, playery, petnumber) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petmapnumber", npconmap+1) Call SetPlayerMP(index, playermp) Call PlayerMsg(index, "You summoned your pet", GREEN) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 1) Call SendNPC(playermap, npconmap) ElseIf GetVar(GetPlayerName(index) & ".ini", "PET", "activatedbefore", 1) Then If GetVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 0) Then Call ScriptSpawnNpc(npconmap+1, playermap, playerx, playery, petnumber) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 1) Call PlayerMsg(index, "You summoned your pet", GREEN) Call SetPlayerMP(index, playermp) Call SendNPC(playermap, npconmap) End IfExit Sub```here is the .ini:```[PET]activatedbefore=0petactivated=0petattacking=0petdead=0petnumber=0petmapnumber=0petstr=0petdef=0pethp=0petexp=0```i created a .ini file by myself for testing the script….called it sealbreaker and called my char sealbreaker.... but thecommand doesnt do anything... help pls.. =P Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 27, 2009 Share Posted August 27, 2009 the ifs are really bugged.Theres 3 ifs and you only put 1 end if =XYou can try this way``` Case "/summonpet" DIM playerx DIM playery DIM playermap DIM npconmap+1 DIM npconmap DIM playertarget DIM playermp DIM petnumber DIM petsnumber+1 DIM petsnumber DIM petdef DIM petstr DIM petmaxhp DIM pethp DIM petmapnumber playerx = GetPlayerX(index) playery = GetPlayerY(index) playermap = GetPlayerMap(index) npconmap+1 = GetMapNpcNumber(GetPlayerMap(index), index) + 1) npconmap = GetMapNpcNumber(GetPlayerMap(index), index) playertarget = GetPlayerTargetNpc(index) playermp = GetPlayerMP(index) - 20) petnumber = GetVar(GetPlayerName(index) & ".ini", "PET", "petnumber") petsnumber+1 = GetVar("Data.ini", "PETS", "petsnumber") + 1) petsnumber = GetVar("Data.ini", "PETS", "petsnumber") petdef = GetNpcDefense(petnumber) petstr = GetNpcStrength(petnumber) petmaxhp = GetNpcMaxHP(index) pethp = GetNpcHP(petnumber) petmapnumber = GetVar(GetPlayerName(index) & ".ini", "PET", "petmapnumber") If GetVar(GetPlayerName(index) & ".ini", "PET", "activatedbefore", 0) Then If GetVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 0) Then Call PutVar(GetPlayerName(index) & ".ini", "PET", "petnumber", petsnumber+1) Call PutVar("Data.ini", "PETS", "petsnumbers", petsnumber+1) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petdef", 40) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petstr", 35) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petexp", 10) Call ScriptSpawnNpc(npconmap+1, playermap, playerx, playery, petnumber) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petmapnumber", npconmap+1) Call SetPlayerMP(index, playermp) Call PlayerMsg(index, "You summoned your pet", GREEN) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 1) End If Call SendNPC(playermap, npconmap) ElseIf GetVar(GetPlayerName(index) & ".ini", "PET", "activatedbefore", 1) Then If GetVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 0) Then Call ScriptSpawnNpc(npconmap+1, playermap, playerx, playery, petnumber) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 1) Call PlayerMsg(index, "You summoned your pet", GREEN) Call SetPlayerMP(index, playermp) Call SendNPC(playermap, npconmap) End If End IfExit Sub``` Link to comment Share on other sites More sharing options...
kris_hole Posted August 27, 2009 Share Posted August 27, 2009 i count 3 if statements and only 1 end if… Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 27, 2009 Author Share Posted August 27, 2009 i'm such an idiot <.<thank you…. is that all?*testsnow* Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 27, 2009 Share Posted August 27, 2009 Dont know.But if need help in something just call me :D Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 27, 2009 Author Share Posted August 27, 2009 does not work vitinhoo….isnt the Call SendNpc right to the End If wrong? shouldn't it be before the end if?anyway, this isnt working 2 Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 27, 2009 Share Posted August 27, 2009 You dont need the Call SendNpc Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 27, 2009 Author Share Posted August 27, 2009 ok… but that cant be the reason why it's not working.... =/ Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 27, 2009 Share Posted August 27, 2009 Activate ScriptError in data.ini and tell me the error Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 27, 2009 Author Share Posted August 27, 2009 when starting the server it now says:TYPE: 'select' erwartetLINE: 5COLUMN: 4CODE:End Ifo.0 Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 27, 2009 Author Share Posted August 27, 2009 then it says:TYPE: anweisungsende erwartet ( i'm german btw ;D )LINE: 72COLUMN: 12CODE:DIM npconmap+1when i type: /summonpetit says:TYPE: typen unverträglich ( i think it means types dont match or somethin ) 'Commands'LINE: 1COLUMN: 0CODE: ( there is no code… )EDIT:sorry expected you saying i have to write every error i get before i post..so its doublepost - sorry Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 27, 2009 Share Posted August 27, 2009 try removing all the + for the DimsegDim lol+1should beDim lol1 Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 27, 2009 Author Share Posted August 27, 2009 give me a minute…. editing this post then ;D Link to comment Share on other sites More sharing options...
Godlord Posted August 27, 2009 Share Posted August 27, 2009 Too many useless variables, no comparisons where there should be, random + 1's, etc.Regards, Godlord. Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 27, 2009 Author Share Posted August 27, 2009 i want to have the vars for later on…like to have the options....anyways, i deleted any + that wasnt needed.... only error i get is ( at starting) :LINE: 87COLUMN: 59CODE:npconmap1 = GetMapNpcNumber(GetPlayerMap(index), index) + 1)this is the code I'm using atm:``` Case "/summonpet" DIM playerx DIM playery DIM playermap DIM npconmap1 DIM npconmap DIM playertarget DIM playermp DIM petnumber DIM petsnumber1 DIM petsnumber DIM petdef DIM petstr DIM petmaxhp DIM pethp DIM petmapnumber playerx = GetPlayerX(index) playery = GetPlayerY(index) playermap = GetPlayerMap(index) npconmap1 = GetMapNpcNumber(GetPlayerMap(index), index) + 1) npconmap = GetMapNpcNumber(GetPlayerMap(index), index) playertarget = GetPlayerTargetNpc(index) playermp = GetPlayerMP(index) - 20) petnumber = GetVar(GetPlayerName(index) & ".ini", "PET", "petnumber") petsnumber1 = GetVar("Data.ini", "PETS", "petsnumber") + 1) petsnumber = GetVar("Data.ini", "PETS", "petsnumber") petdef = GetNpcDefense(petnumber) petstr = GetNpcStrength(petnumber) petmaxhp = GetNpcMaxHP(index) pethp = GetNpcHP(petnumber) petmapnumber = GetVar(GetPlayerName(index) & ".ini", "PET", "petmapnumber") If GetVar(GetPlayerName(index) & ".ini", "PET", "activatedbefore", 0) Then If GetVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 0) Then Call PutVar(GetPlayerName(index) & ".ini", "PET", "petnumber", petsnumber1) Call PutVar("Data.ini", "PETS", "petsnumbers", petsnumber1) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petdef", 40) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petstr", 35) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petexp", 10) Call ScriptSpawnNpc(npconmap1, playermap, playerx, playery, petnumber) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petmapnumber", npconmap+1) Call SetPlayerMP(index, playermp) Call PlayerMsg(index, "You summoned your pet", GREEN) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 1) End If ElseIf GetVar(GetPlayerName(index) & ".ini", "PET", "activatedbefore", 1) Then If GetVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 0) Then Call ScriptSpawnNpc(npconmap1, playermap, playerx, playery, petnumber) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 1) Call PlayerMsg(index, "You summoned your pet", GREEN) Call SetPlayerMP(index, playermp) End If End IfExit Sub``` Link to comment Share on other sites More sharing options...
kris_hole Posted August 27, 2009 Share Posted August 27, 2009 npconmap1 = GetMapNpcNumber(GetPlayerMap(index), index) + 1)tonpconmap1 = (GetMapNpcNumber(GetPlayerMap(index), index) + 1)or if that doesnt work put it asnpconmap1 = Val(GetMapNpcNumber(GetPlayerMap(index), index) + 1) Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 27, 2009 Author Share Posted August 27, 2009 now it says ( while activating)TYPE: type dismatch ( typen unverträglich at my pc ) '[string: ""]'LINE:92COLUMN: 0CODE: Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 27, 2009 Share Posted August 27, 2009 Int() all the vars all are numbers Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 27, 2009 Author Share Posted August 27, 2009 so…. like:lol = Int(GetVar(blablablablabla) + 1)? Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 27, 2009 Share Posted August 27, 2009 Yeah Link to comment Share on other sites More sharing options...
Godlord Posted August 27, 2009 Share Posted August 27, 2009 @VitinhooxD:> YeahNo.It should be:```Int(GetVar(...)) + 1```and:```PutVar(..., ..., ..., CStr(...))```If using anything other than strings.Regards, Godlord. Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 27, 2009 Author Share Posted August 27, 2009 gives me the same error… =/code:``` Case "/summonpet" DIM playerx DIM playery DIM playermap DIM npconmap1 DIM npconmap DIM playertarget DIM playermp DIM petnumber DIM petsnumber1 DIM petsnumber DIM petdef DIM petstr DIM petmaxhp DIM pethp DIM petmapnumber playerx = GetPlayerX(index) playery = GetPlayerY(index) playermap = GetPlayerMap(index) npconmap1 = Int(GetMapNpcNumber(GetPlayerMap(index), index) + 1) npconmap = GetMapNpcNumber(GetPlayerMap(index), index) playertarget = GetPlayerTargetNpc(index) playermp = Int(GetPlayerMP(index) - 20) petnumber = GetVar(GetPlayerName(index) & ".ini", "PET", "petnumber") petsnumber1 = Int(GetVar("Data.ini", "PETS", "petsnumber") + 1) petsnumber = GetVar("Data.ini", "PETS", "petsnumber") petdef = GetNpcDefense(petnumber) petstr = GetNpcStrength(petnumber) petmaxhp = GetNpcMaxHP(index) pethp = GetNpcHP(petnumber) petmapnumber = GetVar(GetPlayerName(index) & ".ini", "PET", "petmapnumber") If GetVar(GetPlayerName(index) & ".ini", "PET", "activatedbefore", 0) Then If GetVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 0) Then Call PutVar(GetPlayerName(index) & ".ini", "PET", "petnumber", petsnumber1) Call PutVar("Data.ini", "PETS", "petsnumbers", petsnumber1) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petdef", 40) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petstr", 35) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petexp", 10) Call ScriptSpawnNpc(npconmap1, playermap, playerx, playery, petnumber) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petmapnumber", npconmap+1) Call SetPlayerMP(index, playermp) Call PlayerMsg(index, "You summoned your pet", GREEN) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 1) End If ElseIf GetVar(GetPlayerName(index) & ".ini", "PET", "activatedbefore", 1) Then If GetVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 0) Then Call ScriptSpawnNpc(npconmap1, playermap, playerx, playery, petnumber) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 1) Call PlayerMsg(index, "You summoned your pet", GREEN) Call SetPlayerMP(index, playermp) End If End IfExit Sub``` Link to comment Share on other sites More sharing options...
Godlord Posted August 27, 2009 Share Posted August 27, 2009 @Godlord:> No.> > It should be:> ```> Int(GetVar(...)) + 1> ```> and:> ```> PutVar(..., ..., ..., CStr(...))> ```> If using anything other than strings.> > Regards,> Godlord.Regards, Godlord. Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 27, 2009 Author Share Posted August 27, 2009 ``` Case "/summonpet" DIM playerx DIM playery DIM playermap DIM npconmap1 DIM npconmap DIM playertarget DIM playermp DIM petnumber DIM petsnumber1 DIM petsnumber DIM petdef DIM petstr DIM petmaxhp DIM pethp DIM petmapnumber playerx = GetPlayerX(index) playery = GetPlayerY(index) playermap = GetPlayerMap(index) npconmap1 = Int(GetMapNpcNumber(GetPlayerMap(index), index)) + 1 npconmap = GetMapNpcNumber(GetPlayerMap(index), index) playertarget = GetPlayerTargetNpc(index) playermp = Int(GetPlayerMP(index) - 20) petnumber = GetVar(GetPlayerName(index) & ".ini", "PET", "petnumber") petsnumber1 = Int(GetVar("Data.ini", "PETS", "petsnumber")) + 1 petsnumber = GetVar("Data.ini", "PETS", "petsnumber") petdef = GetNpcDefense(petnumber) petstr = GetNpcStrength(petnumber) petmaxhp = GetNpcMaxHP(index) pethp = GetNpcHP(petnumber) petmapnumber = GetVar(GetPlayerName(index) & ".ini", "PET", "petmapnumber") If GetVar(GetPlayerName(index) & ".ini", "PET", "activatedbefore", 0) Then If GetVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 0) Then Call PutVar(GetPlayerName(index) & ".ini", "PET", "petnumber", petsnumber1) Call PutVar("Data.ini", "PETS", "petsnumbers", petsnumber1) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petdef", 40) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petstr", 35) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petexp", 10) Call ScriptSpawnNpc(npconmap1, playermap, playerx, playery, petnumber) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petmapnumber", npconmap+1) Call SetPlayerMP(index, playermp) Call PlayerMsg(index, "You summoned your pet", GREEN) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 1) End If ElseIf GetVar(GetPlayerName(index) & ".ini", "PET", "activatedbefore", 1) Then If GetVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 0) Then Call ScriptSpawnNpc(npconmap1, playermap, playerx, playery, petnumber) Call PutVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 1) Call PlayerMsg(index, "You summoned your pet", GREEN) Call SetPlayerMP(index, playermp) End If End IfExit Sub```so like this? ( oh btw, read your answer after posting…sorry... ;D ) Link to comment Share on other sites More sharing options...
Godlord Posted August 27, 2009 Share Posted August 27, 2009 ```If GetVar(GetPlayerName(index) & ".ini", "PET", "activatedbefore", 0) Then```Should be:```If Int(GetVar(GetPlayerName(index) & ".ini", "PET", "activatedbefore")) = 0 Then``````Call PutVar(GetPlayerName(index) & ".ini", "PET", "petactivated", 1)```Should be:```Call PutVar(GetPlayerName(index) & ".ini", "PET", "petactivated", "1")```or:```Call PutVar(GetPlayerName(index) & ".ini", "PET", "petactivated", CStr(1))```To give just a few examples.Regards, Godlord. 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