Page 1 of 2

[GAME MODE]SMG Warz

Posted: Fri Nov 15, 2013 1:44 am
by Bux Xray
hi..could someone test my script? cuz I dont have server

its used for Skilled smg user or wants to practice using smg
you cant use any guns exept SMG

and if you have low health , Kill a player then you will get 5 hp
Code: Select all
#SMG WARZ Game Mode
#by BOYuXRAY
#version 1
#inspired by Kuma`s script
 
from pyspades.constants import *
from random import randint
from twisted.internet.reactor import callLater
 
SMG_ONLY = "You cant kill with Rifle,Shotgun Use SMG!"
 
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)
            self.send_chat(SMG_ONLY)
            return false
 
    class SMGwarProtocol(protocol):
        game_mde = CTF_MODE
        starting_hp = config.get("start_hp_on_hit",10)
        startig_hp = config.get("start_hp",100)
 
  return SMGwarProtocol, SMGwarConnection
if it did not work,YAY...I`m just beginner xD

Re: [GAME MODE]SMG Warz

Posted: Fri Nov 15, 2013 7:34 am
by Kuma
There are many faults with this script.
You are missing many semi colons in the script ":", also in "return false" the f in the false should be capital. Then the spelling of game_mode is wrong, also you don't really need that many imports. (You are not using randint and callLater anywhere) Also if we return False on_weapon_set, on reload the weapon will be broken so yeah.

fixed version (but reloading breaks the gun)
Code: Select all
#SMG WARZ Game Mode
#by BOYuXRAY
#version 1
#inspired by Kuma`s script
 
from pyspades.constants import *
 
SMG_ONLY = "You cant kill with Rifle or Shotgun. Use the SMG!"
 
def apply_script(protocol, connection, config): #Error here
 
    class SMGwarConnection(connection): #Error here
        def spawn(self):#Error here
            self.weapon = SMG_WEAPON
            return connection.spawn(self)
 
        def on_weapon_set(self, weapon): #Error here
            self.send_chat(SMG_ONLY)
            return False #Error here
 
    class SMGwarProtocol(protocol):
        game_mode = CTF_MODE #Error here

    return SMGwarProtocol, SMGwarConnection
Another version in which I fixed the reloading part.
Code: Select all
#SMG WARZ Game Mode
#by BOYuXRAY
#version 1
#inspired by Kuma`s script
 
from pyspades.constants import *
 
SMG_ONLY = "You cannot kill with Rifle or Shotgun. Use the SMG!"
 
def apply_script(protocol, connection, config): #Error here
 
    class SMGwarConnection(connection): #Error here
        def spawn(self):#Error here
            self.weapon = SMG_WEAPON
            return connection.spawn(self)
 
        def on_weapon_set(self, weapon): #Error here
            if weapon in [RIFLE_WEAPON, SHOTGUN_WEAPON]:
                self.send_chat(SMG_ONLY)
                self.set_weapon(SMG_WEAPON)
            return False
 
    class SMGwarProtocol(protocol):
        game_mode = CTF_MODE #Error here

    return SMGwarProtocol, SMGwarConnection


Re: [GAME MODE]SMG Warz

Posted: Fri Nov 15, 2013 10:59 am
by Bux Xray
SMG War
Version 2

-Fixed a silly mistake
-Fixed by Kuma
-Fixed the reload part
-Fixed Error

I hope I can do another version Green_Cookie Green_Cookie

SMG War
SMG War is used by Players who want to fight with smg and want to fight an enemy using SMG

Download :
attachment=0]SMGwar.py[/attachment

Re: [GAME MODE]SMG Warz

Posted: Fri Nov 15, 2013 11:34 am
by Bux Xray
Cheat For All
Version 3

-Added some features
-same as SMG War version 2
with some features
-added /fly to add some
intense
-added /smghelp to guide
players

Commands
/fly - makes you fly like a bird :3
/smghelp - guides you with the commands



[HELP]Did not work :( ,
so pls. help me :(
Code: Select all
#SMG WARZ Game Mode
#by BOYuXRAY
#version 3
#inspired by Kuma`s script
#added some features
 
from pyspades.constants import *
from commands import add, alias, admin, name, move
from twisted.internet.task import LoopingCall
 
SMG_ONLY = "You cannot kill with Rifle or Shotgun. Use the SMG!"

@alias ('fly')
def fly(connection)
    protocol = connection.protocol
        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 like a bird'
            player.send_chat("You're {0}".format(message))

def smghelp(connection):
    protocol = connection.protocol
    help = ["-" * 50,"Some of the commands are: /fly,/smghelp","anyone cant use rifle and shotgun,use SMG","Good luck!"
    if connection in protocol.players:
        for line in help:
            connection.send_chat(line)

 
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
 
    class SMGwarProtocol(protocol):
        game_mode = CTF_MODE

    return SMGwarProtocol, SMGwarConnection

Re: [GAME MODE]SMG Warz

Posted: Fri Nov 15, 2013 3:26 pm
by learn_more
so now this topic is: help box paste shit together?

Re: [GAME MODE]SMG Warz

Posted: Fri Nov 15, 2013 6:37 pm
by MKU
learn_more wrote:
so now this topic is: help box paste shit together?
halp him

Re: [GAME MODE]SMG Warz

Posted: Fri Nov 15, 2013 10:33 pm
by Bux Xray
yeah...so this is like a [REQUEST] Now xD

Re: [GAME MODE]SMG Warz

Posted: Fri Nov 15, 2013 10:52 pm
by learn_more
Bux Xray wrote:
yeah...so this is like a [REQUEST] Now xD
yeah well have you thought about giving a bit more info than:

DUN WURK

Re: [GAME MODE]SMG Warz

Posted: Fri Nov 15, 2013 11:14 pm
by Bux Xray
I keep improving the SMGwar and fixing it
and still I dont know if it will work
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)

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
 

    class SMGwarConnection(connection):
        smgwar_fly = true

    class SMGwarProtocol(protocol):
        game_mode = CTF_MODE


    return SMGwarProtocol, SMGwarConnection
Improves
-admins can enabled and disabled SMGwar now
by doing /SMGwar
-same like version3 ,with /fly to add some
intense
-added /smgwarhelp to guide some players that
did not know

If this works
I recommend adding to tips "type /smgwarhelp for the game mode guide"

Re: [GAME MODE]SMG Warz

Posted: Sat Nov 16, 2013 12:25 am
by Kuma
You are just copying my peace script. And even failing at that.
This won't work.

Re: [GAME MODE]SMG Warz

Posted: Sat Nov 16, 2013 12:55 am
by tungdil
If you made a clan, i'd join it bux xXXDDDd.

Re: [GAME MODE]SMG Warz

Posted: Sat Nov 16, 2013 4:18 am
by Bux Xray
oh............just copied the /fly then the idea /help

Re: [GAME MODE]SMG Warz

Posted: Sat Nov 16, 2013 4:20 am
by Bux Xray
are you serious xD

I have xD
it have a weird name xD because I just made it for fun before
then I decided to make it public

BOLTZ ULTRA ZYBORGS

Re: [GAME MODE]SMG Warz

Posted: Sat Nov 16, 2013 11:39 am
by Kuma
Anyways, I am not going to fix that script for you. Learn to read the errors the interpreter gives to you. You make really stupid mistakes all the time, and you have just copy pasted code and still fail at that. There are problems with the indentation, naming the booleans wrong, stupid spelling mistakes. You have included a toggle command which is of no use (You have not added a if statement, so people will still spawn with smgs, and you are not using my reload fix so they can't fire after reloading), If you really want to learn scripting, learn the basics of programming, learn python and then come here.

Re: [GAME MODE]SMG Warz

Posted: Sat Nov 16, 2013 1:34 pm
by learn_more
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.