SphereCommunity
Gift per IP - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Gift per IP (/Thread-Gift-per-IP)



Gift per IP - tyllneas - 11-02-2012 08:56 AM

Hello! I have a question where there is a mistake
I need to give new player's a gift Per IP addres ! Help plzz
Quote:[ITEMDEF i_gift_stone]
ID=i_gravestone_17
TYPE=T_Script
NAME=Gift Stone

ON=@CREATE
COLOR=04ad
ATTR=010

ON=@CLICK
MESSAGE @042b <name>
message @0444 Total gifs receive: <eval <tag0.giftsgive>>
RETURN 1

ON=@DCLICK
IF (<distance> > 6)
SRC.SYSMESSAGE You're too far from <name>.
RETURN 1
ELSE
SDIALOG d_gift_stone
RETURN 1
ENDIF

[DIALOG d_gift_stone]
330,200
resizepic 0 0 3600 320 200
dtext 90 22 07a3 Gift's for free!
dtext 40 57 1152 PvP Disabled - 14 days!
dtext 40 77 1152 Prof Account - 14 days!
dtext 40 97 1152 200.000 gp!
dtext 40 117 52 5 Lvl with max skills!
dtext 50 147 57 Take the gift!
dtext 170 165 80 Only 1 gift per ip!

button 30 150 1209 1210 1 0 1

[DIALOG d_gift_stone BUTTON]
ON=1
IF (<distance> > 6)
SRC.SYSMESSAGE You're too far from <name>.
RETURN 1
ENDIF

FOR 1 <eval <tag0.giftplayers>>
IF (<tag0.giftplayer_lastip_<eval <local._for>>> == <SRC.ACCOUNT.LASTIP>) && (<SRC.ACCOUNT.LASTIP> != 10.10.10.1)
SRC.SYSMESSAGE @50 Your IP already take the gift.
RETURN 1
ENDIF
END
IF (<SRC.ISPLAYER>)
IF (<SRC.ISMAGE>)
src.tag0.giftplayer_lastip_<eval <tag0.players>> = <src.account.lastip>
src.tag0.giftplayers
SRC.skillclass Class_mage5
SRC.rskill_mage 1500,1500,1500,1000,1500,1500,1500,1500,1000,1000
SRC.tag0.level 5
SRC.title Level 5 Mage
SRC.tag.perenos 1
SERV.NEWITEM I_MONEY_DEED
NEW.TAG.AM = 200000
NEW.MORE1 = 200000
NEW.CONT = <SRC.FINDLAYER.21.UID>
SRC.SYSMESSAGE @042b You successfully receive the gift. To obtain the necessary parameters enter: ".fixstatus".
SRC.tag.msgsend = <serv.name>
SRC.events +e_message
ELIF (<SRC.ISARCHER>)
src.tag0.giftplayer_lastip_<eval <tag0.players>> = <src.account.lastip>
src.tag0.giftplayers
SRC.skillclass Class_archer5
SRC.rskill_archer 1500,1500,1500,1500,1000,1500,1500,1500,1500,1500
SRC.tag0.level 5
SRC.title Level 5 Archer
SRC.tag.perenos 1
SERV.NEWITEM I_MONEY_DEED
NEW.TAG.AM = 200000
NEW.MORE1 = 200000
NEW.CONT = <SRC.FINDLAYER.21.UID>
SRC.SYSMESSAGE @042b You successfully receive the gift. To obtain the necessary parameters enter: ".fixstatus".
SRC.tag.msgsend = <serv.name>
SRC.events +e_message
ELIF (<SRC.ISWARIOR>)
src.tag0.giftplayer_lastip_<eval <tag0.players>> = <src.account.lastip>
src.tag0.giftplayers
SRC.skillclass Class_warior5
SRC.rskill_warrior 1500,1500,1500,1000,1500,1500,1500,1500,1500,1500
SRC.tag0.level 5
SRC.title Level 5 Warrior
SRC.tag.perenos 1
SERV.NEWITEM I_MONEY_DEED
NEW.TAG.AM = 200000
NEW.MORE1 = 200000
NEW.CONT = <SRC.FINDLAYER.21.UID>
SRC.SYSMESSAGE @042b You successfully receive the gift. To obtain the necessary parameters enter: ".fixstatus".
SRC.tag.msgsend = <serv.name>
SRC.events +e_message
ELIF (<SRC.ISCLERIK>)
src.tag0.giftplayer_lastip_<eval <tag0.players>> = <src.account.lastip>
src.tag0.giftplayers
SRC.skillclass Class_clerik5
SRC.rskill_clerik 1500,1500,1500,1500,1500,1000,1000,1500,1500,1500
SRC.tag0.level 5
SRC.title Level 5 Cleric
SRC.tag.perenos 1
SERV.NEWITEM I_MONEY_DEED
NEW.TAG.AM = 200000
NEW.MORE1 = 200000
NEW.CONT = <SRC.FINDLAYER.21.UID>
SRC.SYSMESSAGE @042b You successfully receive the gift. To obtain the necessary parameters enter: ".fixstatus".
SRC.tag.msgsend = <serv.name>
SRC.events +e_message
ELSE
SYSMESSAGE @50 You already receive gift!
ENDIF
ELSE
SYSMESSAGE @50 Only for players!
ENDIF
tag0.giftsgive +=1

IF !(<src.findid.i_nonpvp_timer>)
SERV.NEWITEM I_NONPVP_TIMER
NEW.CONT = <SRC.UID>
NEW.TIMER = <EVAL((3600*24*14*9)/10)>
ELSE
SRC.FINDID.I_NONPVP_TIMER.TIMER = <EVAL <FINDID.I_NONPVP_TIMER.TIMER>+((3600*24*14*9)/10)>
ENDIF

if (<src.findid.i_prof_timer>)
src.findid.i_prof_timer.timer = <src.findid.i_prof_timer.timer> + (<EVAL((3600*24*14*9)/10)>)
src.sysmessage @50 Command: .prof - total professional account days.
src.sysmessage @50 Command: .powerhour - power hour (enable/disable).
src.sysmessage @50 Command: .pvptime - total nonpvp account hours.
src.sysmessage @50 Command: .pvp - on/off nonpvp mode!
custs profacc_<eval <tag0.bitemdel>>
var.prof=
return 1
endif
src.NEWITEM I_PROF_TIMER
src.EQUIP <NEW.UID>
NEW.TIMER=<EVAL((3600*24*14*9)/10)>
SERV.NEWITEM I_REGEN_BONUS
src.EQUIP <NEW.UID>
NEW.TIMER=1
src.sysmessage @50 Command: .prof - total professional account days.
src.sysmessage @50 Command: .powerhour - power hour (enable/disable).
src.sysmessage @50 Command: .pvptime - total nonpvp account hours.
src.sysmessage @50 Command: .pvp - on/off nonpvp mode!
custs profacc_<eval <tag0.bitemdel>>
var.prof=
RETURN 1



RE: Plss HELP - ShiryuX - 11-03-2012 01:22 AM

You should name your topic "Gift per IP" and not "PLSSS HELP!!!", be descriptive with the title.


RE: Plss HELP - Barnabus - 11-03-2012 02:10 AM

Code is so hard to read without indentation.......

At a Glance ::
That FOR Loop has no ENDFOR

Code:
FOR
    // Everything to be looped
ENDFOR



RE: Plss HELP - tyllneas - 11-03-2012 02:24 AM

Its all OKE all FIxed !


RE: Plss HELP - ShiryuX - 11-03-2012 04:04 AM

(11-03-2012 02:10 AM)Barnabus Wrote:  Code is so hard to read without indentation.......

At a Glance ::
That FOR Loop has no ENDFOR

Code:
FOR
    // Everything to be looped
ENDFOR

He used END, is the same as ENDFOR.


RE: Plss HELP - Barnabus - 11-03-2012 06:59 AM

exactly!