Eclipse
January 05, 2009, 04:25:38 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Chat Help Rules Arcade Search Calendar Gallery Login Register  
 
 
 
Recent Topics +-
[Real Life Picture Thread] by The Oracle
Today at 04:25:17 PM

The New Eclipse Raid on Runscape by Simius Cruentus
Today at 04:23:33 PM

Spike's Adminishness! by The Oracle
Today at 04:23:31 PM

Free movies? by The Oracle
Today at 04:21:59 PM

How do i make npcs "talk"? by The Oracle
Today at 04:21:19 PM

what? by Paladin
Today at 04:20:59 PM

Sylerean Online Alpha 1.2 Released by The MrMiguu™ [pizza pretzles]
Today at 04:20:15 PM

One of the most amazing fonts discovered by slym. - harrington. by slym
Today at 04:19:47 PM

PLEASE HELP RTE 2147024770(8007007e) by colby250
Today at 04:17:29 PM

I'm New/Back/Leaving! by The Oracle
Today at 04:08:25 PM

Members Online +-
15 Guests, 32 Users
Maxac,
The Oracle,
Chief,
‪‫‬‭‮‪‫‬‭Admiral Refuge,
Jax The Mighty,
Balliztik,
Paladin,
Gwendalin,
Airscar,
>~(Squiddle)~<,
ShadowChao,
Simius Cruentus,
ralir,
Munro,
slym,
THE Tim,
Reguba,
grenegg1,
tiggilyboo,
Almighty Wing,
newman,
Hikaru,
The MrMiguu™ [pizza pretzles],
ploxie,
HawkStorm95,
Zuleloan,
colby250,
Marsh,
timster0,
‪‫‬‭‮‪‫Kusy,
DragonFire,
azkanan
Pages: [1]
  Print  
Author Topic: Male/Female PD (Difficulty: 2/5)  (Read 1640 times)
0 Members and 1 Guest are viewing this topic.
~.:Lidnel:.~
Active Member
***
Offline Offline

Posts: 366

The truth is out there...


View Profile WWW Email
« on: February 10, 2007, 07:03:00 AM »



Non-Scripter [2/5]
Beginner [2/5]
Advanced Scripter [1/5]
Expert [1/5]
Pro Scripter [1/5]


This script is very simple. It was created for changing armors to right gender. It works like this: first 100 items - male armors, second 100 - female.

Sub JoinGame(index)
Code: [Select]
Call SetTimer("tmrtest " & index & "," & X, 15)
Sub TMRTEST(index, Script)
Code: [Select]
Case 1
        Dim i
        Dim armor
        i = 1
        armor = GetPlayerArmorSlot(index)
        If armor => 1 Then 'From what item #
            If armor =< 100 Then 'To what item #
                If GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Sex") = 1 Then '0 - male; 1 - female

                    Do While (i <= 24) 'Something like that I am now mainly busy with PHP
                        If GetPlayerInvItemNum(INDEX, i) = armor then
                            Call SetPlayerInvItemNum(index, i, int(armor)+100)
                            Call SendInventoryUpdate(INDEX, i)
                            Call SendWornEquipment(index)
                            Call SendPlayerData(index)
                            i = 25
                        Else
                            i = i + 1
                         End If
                      Loop
                 End If
            End If
        End If
    End Select
End Sub
Godlord
Stephanus sum
Veteran
Teh Uberleet
*
Offline Offline

Posts: 4,109


View Profile WWW Email
« Reply #1 on: February 14, 2007, 04:42:33 AM »

Lidnel here try with this:
Code: [Select]
Sub TMRTEST(index, Script)
    Case 1
        Dim i
        Dim armor
        i = 1
        armor = GetPlayerArmorSlot(index)
        If armor => 1 Then 'From what item #
            If armor =< 100 Then 'To what item #
                If GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Sex") = 1 Then '0 - male; 1 - female

                    Do While (i <= 24) 'Something like that I am now mainly busy with PHP
                        If GetPlayerInvItemNum(INDEX, i) = armor then
                            Call SetPlayerInvItemNum(index, i, int(armor)+100)
                            Call SendInventoryUpdate(INDEX, i)
                            Call SendWornEquipment(index)
                            Call SendPlayerData(index)
                            i = 25
                        Else
                            i = i + 1
                         End If
                      Loop
                 End If
            End If
        End If
    End Select
End Sub
~.:Lidnel:.~
Active Member
***
Offline Offline

Posts: 366

The truth is out there...


View Profile WWW Email
« Reply #2 on: February 14, 2007, 07:05:27 AM »

Thanks for edit )
Godlord
Stephanus sum
Veteran
Teh Uberleet
*
Offline Offline

Posts: 4,109


View Profile WWW Email
« Reply #3 on: February 14, 2007, 10:23:12 AM »

No problem. I taught that that way stands in my Sadscript tutorial.
Pages: [1]
  Print  
 
 

Powered by EzPortal
Powered by MySQL Powered by PHP Powered by SMF 2.0 Beta 4 | SMF © 2006–2008, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!
Page created in 0.287 seconds with 32 queries.