Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Help With a script


VitinhooxD
 Share

Recommended Posts

Hello everyone!
I need help with a script
Could someome make it works like that:

The variable is in the server folder , guild.ini file when someone creates a guild by the npc(i have the script made but i need help with this part, but when other player creates another guild the old variable stay there,and the new variable enter too
the code is
```
Call PutVar( "guilds.ini" , "GUILD" , "GuildName" ,""&Value)
```
Thanks for helping!!
Link to comment
Share on other sites

i want to all the guilds names be put in the ini file when the player creates de guild using the npc of guld creation

The entire code is this:
```
      Select Case Prompt
        Case 0

Select Case Value

'In this 1º and 2º parameters the server check  that player dont have access to create a guild with the names [GM] or [MOD]  then the prompt quit     
Case "[GM]"
If GetPlayerAccess(index) <= 4 Then
Call PlayerMsg(index , "You need more access to create a guild with this name",11)
Else
If GetPlayerAccess(index) = 5 Then
Call PutVar( "guilds.ini" , "GUILD" , "GuildName" ,""&Value)
Call PutVar("Accounts\" & GetPlayerName(index) & ".ini" , "GUILD" , "GuildName" ,""&Value) 
Call PutVar("Accounts\" & GetPlayerName(index) & ".ini" , "GUILD" , "GuildAccess" ,"4")
Call SetPlayerGuild(index ,""& Value  )
Call SetPlayerGuildAccess(index , 4 )

End If
End If

Case "[MOD]"
If GetPlayerAccess(index) <= 3 Then
Call PlayerMsg(index ,"You need more acces to create a guild with this name",11)
Else
If GetPlayerAccess(index) >= 3 Then
Call PutVar( "guilds.ini" , "GUILD" , "GuildName" ,""&Value)
Call PutVar("Accounts\" & GetPlayerName(index) & ".ini" , "GUILD" , "GuildName" ,""&Value) 
Call PutVar("Accounts\" & GetPlayerName(index) & ".ini" , "GUILD" , "GuildAccess" ,"4")
Call SetPlayerGuild(index ,""& Value  )
Call SetPlayerGuildAccess(index , 4 )

End If
End If

'Here the server create the player guild
Case Else
exist = GetVar("guilds.ini" ,"GUILD" , "GuildName")

If exist = Value Then
Call PlayerMsg(index ,"This guild name is already in use , try other name " ,RED)
End If

If F_Check_Take(index , 1 , 10000) Then
Call Take_Item(index, 1 , 10000)
Call PutVar( "guilds.ini" , "GUILD" , "GuildName" ,""&Value)
Call PutVar("Accounts\" & GetPlayerName(index) & ".ini" , "GUILD" , "GuildName" ,""&Value) 
Call PutVar("Accounts\" & GetPlayerName(index) & ".ini" , "GUILD" , "GuildAccess" ,"4")
Call SetPlayerGuild(index ,""& Value  )
Call SetPlayerGuildAccess(index , 4 )

Else
Call PlayerMsg(index , "You need 10000 Gold to create a guild" , RED)

End If
End Select

Case 1

Select Case Value
Case "delete"
                                                                          Call PutVar( "guilds.ini" , "GUILD" , "GuildName" ,"")
Call PutVar("Accounts\" & GetPlayerName(index) & ".ini" , "GUILD" , "GuildName" , "none")
                                                                          Call PutVar("Accounts\" & GetPlayerName(index) & ".ini" , "GUILD" , "GuildAccess" , "0")
                                                                          Call SetPlayerGuild(index ,"")
                                                                          Call SetPlayerGuildAccess(index,0)

Exit Sub

```
I want to put in the ini fine only this Call PutVar( "guilds.ini" , "GUILD" , "GuildName" ,""&Value) but , (not only 1 guild name) , all the guilds names.

Thanks!
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...