[GAME MODE]SMG Warz

Incomplete code that isn't ready for use.
25 posts Page 2 of 2 First unread post
Kuma
Scripter
Scripter
Posts: 758
Joined: Fri Mar 22, 2013 10:05 am


learn_more wrote:
if you can't read the errors the server gives you then you shouldnt even try anymore.
if you can read em, you can make anything.
learn_more just compressed what I said in two lines.
Bux Xray
3 Years of Ace of Spades
3 Years of Ace of Spades
Posts: 218
Joined: Sat Aug 24, 2013 9:07 am


Kuma,I know ........
Bux Xray
3 Years of Ace of Spades
3 Years of Ace of Spades
Posts: 218
Joined: Sat Aug 24, 2013 9:07 am


learn_more wrote:
if you can't read the errors the server gives you then you shouldnt even try anymore.
if you can read em, you can make anything.
umm...I dont have server
ummm.....when I still have....I cant see cuz its closing too fast
tungdil
League Participant
League Participant
Posts: 517
Joined: Mon May 06, 2013 4:28 pm


You need the slowmotion skill to become a coder.
Kuma
Scripter
Scripter
Posts: 758
Joined: Fri Mar 22, 2013 10:05 am


Bux Xray wrote:
learn_more wrote:
if you can't read the errors the server gives you then you shouldnt even try anymore.
if you can read em, you can make anything.
umm...I dont have server
ummm.....when I still have....I cant see cuz its closing too fast
if you use pysnip and it is closing too fast, it means that you are directly running run.exe. You should use run.bat
.
learn_more
Coder
Coder
Posts: 891
Joined: Sun Mar 24, 2013 9:59 pm


Bux Xray wrote:
learn_more wrote:
if you can't read the errors the server gives you then you shouldnt even try anymore.
if you can read em, you can make anything.
umm...I dont have server
ummm.....when I still have....I cant see cuz its closing too fast
are you really this thick?

open a command window, run it from there....

while ur at it, load the module common sense 1.0
tungdil
League Participant
League Participant
Posts: 517
Joined: Mon May 06, 2013 4:28 pm


Or just slowmotion ;). (your body has to level up for it)
Bori
League Participant
League Participant
Posts: 28
Joined: Sun Nov 11, 2012 2:41 pm


I think we can work here a bit:
Code: Select all
#SMGwar by BOYuXRAY
#Version 3
#fixed Version

from commands import add, alias, admin, name, move
from twisted.internet.task import LoopingCall

SMGWAR_ENABLED_MESSAGE = "SMGwar enabled!players must use smg now!"
SMGWAR_DISABLED_MESSAGE = "SMGwar disabled!Players can use any weapons now!"
NO_SMGWAR = "No,SMGwar enabled"
SMG_ONLY = "you cant use shotgun,rifle use SMG!"
SMGWAR = true

@alias('SMGwar')
@admin
def smgwarmode(connection)
    global SMGWAR, strip
    protocol = connection.protocol
    SMGWAR = not SMGWAR
    if SMGWAR:
        protocol.send_chat(PEACE_ENABLED_MESSAGE)
    else
        protocol.send_chat(PEACE_DISABLED_MESSAGE)

@alias('fly')
def smgwar_fly(connection):
    protocol = connection.protocol
    if SMGWAR:
        if connection in protocol.players:
            player = connection
            player.fly = not player.fly
            message = 'now flying like a bird' if player.fly else 'no longer flying'
            player.send_chat("You're {0}".format(message))
    else:
        connection.send_chat(NO_SMGWAR)

def smgwarhelp(connection):
    protocol = connection.protocol
    help = ["-" * 50,"Some of the commands are: /f","in smg war,you can only use smg,"good luck!", "-" * 50]
    if connection in protocol.players:
        for line in help:
            connection.send_chat(line)

add(smgwarmode)
add(smgwarhelp)
add(smgwar_fly)

#Sorry dude but this part above is totally copied from peace.py by Kuma
#anyway when you are new at scripting then don't start with commands then

def apply_script(protocol, connection, config):

   class SMGwarConnection(connection):
        def spawn(self):
            self.weapon = SMG_WEAPON
            return connection.spawn(self)

 def on_weapon_set(self, weapon):
            if weapon in [RIFLE_WEAPON, SHOTGUN_WEAPON]:
                self.send_chat(SMG_ONLY)
                self.set_weapon(SMG_WEAPON)
            return False
 def on_block_destroy(self, x, y, z, mode):
             if player.weapon == SMG_WEAPON:
                     return False
             return connection.on_block_destroy(self, x, y, z, mode)
#Just added so noone can grief with Smg (I hope it is right, cuz I am a noob too :D)
    class SMGwarConnection(connection):
        smgwar_fly = true
        #delete this shit
#2 connections lawl
    class SMGwarProtocol(protocol):
        game_mode = CTF_MODE#won't work delete it


    return SMGwarProtocol, SMGwarConnection
Fixed:
Code: Select all
#SMGwar by BOYuXRAY
#Version 3
#fixed Version

from pyspades.weapon import WEAPONS#import for using weapons

NO_SMGWAR = "No,SMGwar enabled"

def apply_script(protocol, connection, config):

   class SMGwarConnection(connection):
        def spawn(self):
            self.weapon = SMG_WEAPON
            return connection.spawn(self)

 def on_weapon_set(self, weapon):
            if weapon in [RIFLE_WEAPON, SHOTGUN_WEAPON]:
                self.send_chat(SMG_ONLY)
                self.set_weapon(SMG_WEAPON)
            return connection.on_weapon_set(self, weapon)
 
      return protocol, SMGwarConnection
Maybe I made some mistakes, sorry for that
See ya Guys
Bori
Kuma
Scripter
Scripter
Posts: 758
Joined: Fri Mar 22, 2013 10:05 am


Bori wrote:
Maybe I made some mistakes, sorry for that
>fixes a script
>claims that there might be mistakes

Can't you guys test this stuff before releasing them?
IceCream
Hoster
Hoster
Posts: 322
Joined: Thu Nov 01, 2012 12:18 pm


>smgwarz pls noone needs the smg
25 posts Page 2 of 2 First unread post
Return to “Work In Progress”

Who is online

Users browsing this forum: No registered users and 14 guests