|
Iceknight
|
 |
« on: March 31, 2006, 07:22:52 AM » |
|
I have just programmed a script which created a system: "Capture The Flag"
One needs that you item put boxes with the flag of each team in each base, for side you put the suitable scriptées boxes. (to supplement script, you have only to change the sentences between [ ] by the good number.)
Im french, and im using the translator for translate my script in english.
**CASE** ___________________________________________________
'***script Capture the flag*** 'put to place beside the flag of the red team case 8 dim shieldslot shieldslot = getvar("shieldslot.ini", "ShieldSlot", Getplayername(index)) if getplayersprite(index) = [# sprite of the reds] then if getplayerinvitemnum(index, getplayershieldslot(index)) = [# item of "blue flag"] then call putvar("capturetheflag.ini", "points", "rouges", getvar("capturetheflag.ini", "points", "rouges") +1) call mapmsg(11, "The reds have now " & getvar("capturetheflag.ini", "points", "rouges") & " points!", 13) call putvar("shieldslot.ini", "ShieldSlot", Getplayername(index), getplayershieldslot(index)) call setplayerinvitemnum(index, GetPlayerShieldSlot(index), 0) call SetPlayerShieldSlot(INDEX, 0) call SendWornEquipment(index) call sendinventoryupdate(index, shieldslot) end if end if 'put to place beside the flag of the blue team case 9 shieldslot = getvar("shieldslot.ini", "ShieldSlot", Getplayername(index)) if getplayersprite(index) = [# sprite of the blue] then if getplayerinvitemnum(index, getplayershieldslot(index)) = [# item of "red flag"] then call putvar("capturetheflag.ini", "points", "bleus", getvar("capturetheflag.ini", "points", "bleus") +1) call mapmsg(11, "Les bleus ont maintenant " & getvar("capturetheflag.ini", "points", "bleus") & " points!", 13) call putvar("shieldslot.ini", "ShieldSlot", Getplayername(index), getplayershieldslot(index)) call setplayerinvitemnum(index, GetPlayerShieldSlot(index), 0) call SetPlayerShieldSlot(INDEX, 0) call SendWornEquipment(index) call sendinventoryupdate(index, shieldslot) end if end if
**COMMANDS** ___________________________________________________
case "/reset" if getplayermap(index) = [# of the map] then call putvar("capturetheflag.ini","points","bleus", 0) call putvar("capturetheflag.ini","points","rouges", 0) call mapmsg([# de la map], "The points were given to zero", 4) end if exit sub case "/score" if getplayermap(index) = [# of the map] then call playermsg(index, "the reds have" & getvar("capturetheflag.ini","points","rouges") & "points", 12) call playermsg(index, "the blue have" & getvar("capturetheflag.ini","points","bleus") & "points", 9) end if exit sub
Bleu = Blue Red = Rouge Points = Points
|