Raised This Month: $51 Target: $400
 12% 

[ZP] Extra Server Addon : zTele


Post New Thread Reply   
 
Thread Tools Display Modes
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 12-31-2009 , 19:53   Re: [ZP] Extra Server Addon : zTele
Reply With Quote #11

What about MultiLangual?
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 01-01-2010 , 04:49   Re: [ZP] Extra Server Addon : zTele
Reply With Quote #12

Quote:
Originally Posted by crazyeffect View Post
What about MultiLangual?
yea, probably i could add ML.
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 01-01-2010 , 15:01   Re: [ZP] Extra Server Addon : zTele
Reply With Quote #13

This plugin has a lot of retardness in it, for example:
PHP Code:
if (zp_get_user_zombie(id))
            {
                
teleport_player(id)
                
client_print(idprint_chat"[ZP] You are now teleported away as zombie.")
                
client_print(idprint_chat"[ZP] You have teleported %d of %d times"get_pcvar_num(g_ztele_max))
            }
            
            else if (
zp_get_user_nemesis(id))
            {
                
g_used[id] = 0
                g_canztele
[id] = false
                
                client_print
(idprint_chat"[ZP] Sorry but nemesis can't teleport")
                
                return 
PLUGIN_HANDLED
            

Dude, a nemesis is still zombie.

PHP Code:
public client_connect(id)
{
    
g_used[id] = 0
    g_canztele
[id] = false
}

public 
client_disconnect(id)
{
    
g_used[id] = 0
    g_canztele
[id] = false

Why reseting twice?

PHP Code:
client_print(idprint_chat"[ZP] You have teleported %d of %d times"get_pcvar_num(g_ztele_max)) 
You forgot about one argument.

PHP Code:
g_canztele[id] = false 
You always set it to false, and you never use it (you never block teleporting)

PHP Code:
{
    if (!
is_user_alive(id))
    {
        
g_used[id] = 0
        g_canztele
[id] = false
        
        client_print
(idprint_chat"[ZP] You must be alive to use ztele!")
        
        return 
PLUGIN_HANDLED
    
}
    
    switch (
get_pcvar_num(g_ztele_mode))
    {
        case 
0:
        {
            
teleport_player(id)
            
client_print(idprint_chat"[ZP] You are now teleported to your spawn point.")
            
client_print(idprint_chat"[ZP] You have teleported %d of %d times"get_pcvar_num(g_ztele_max))
        }
        
        case 
1:
        {
            if (
zp_get_user_zombie(id))
            {
                
teleport_player(id)
                
client_print(idprint_chat"[ZP] You are now teleported away as zombie.")
                
client_print(idprint_chat"[ZP] You have teleported %d of %d times"get_pcvar_num(g_ztele_max))
            }
            
            else if (
zp_get_user_nemesis(id))
            {
                
g_used[id] = 0
                g_canztele
[id] = false
                
                client_print
(idprint_chat"[ZP] Sorry but nemesis can't teleport")
                
                return 
PLUGIN_HANDLED
            
}
        }
            
        case 
2:
        {
            if (!
zp_get_user_zombie(id))
            {
                
teleport_player(id)
                
client_print(idprint_chat"[ZP] You are now teleported away as survivor, to your spawn point.")
                
client_print(idprint_chat"[ZP] You have teleported %d of %d times"get_pcvar_num(g_ztele_max))
            }
        }
    }
    
    if (
get_pcvar_num(g_ztele_max) == g_used[id])
    {
        
g_canztele[id] = false
        client_print
(idprint_chat"[ZP] Sorry but you can't ztele anymore you already did %d of %d times"get_pcvar_num(g_ztele_max))
        
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE

Sooo bad coded...


This should be trashed.
01101101 is offline
aaarnas
Veteran Member
Join Date: Jun 2008
Location: Lithuania
Old 01-01-2010 , 15:01   Re: [ZP] Extra Server Addon : zTele
Reply With Quote #14

1. Removed bug - reseting uses being dead.
2. Fixed zp_extra_ztele_mode.
3. Added multilingual.
4. Removed unneeded pcvar "g_canztele".
5. Removed lost of bugs.
6. Added command /tele
6. Added new cvar zp_extra_ztele_players

zp_extra_ztele_mode 0
1 - botch teams can use it
2 - only humans
3 - only zombies
zp_extra_ztele_players 0
0 - survivors and nemesies can use ztele
1 - only survivors
2 - only nemesies
3 - nemesis/survivors can't use it
zp_extra_ztele_max 3

Known things: Player can reconnect, and his used times will be
reseted.
Tested, and working 100%
Attached Files
File Type: txt ztele.txt (717 Bytes, 88 views)
File Type: sma Get Plugin or Get Source (zp_extra_ztele.sma - 397 views - 5.1 KB)

Last edited by aaarnas; 01-01-2010 at 15:05.
aaarnas is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 01-01-2010 , 18:11   Re: [ZP] Extra Server Addon : zTele
Reply With Quote #15

Quote:
Originally Posted by 01101101 View Post
This plugin has a lot of retardness in it, for example:
PHP Code:
if (zp_get_user_zombie(id))
            {
                
teleport_player(id)
                
client_print(idprint_chat"[ZP] You are now teleported away as zombie.")
                
client_print(idprint_chat"[ZP] You have teleported %d of %d times"get_pcvar_num(g_ztele_max))
            }
            
            else if (
zp_get_user_nemesis(id))
            {
                
g_used[id] = 0
                g_canztele
[id] = false
                
                client_print
(idprint_chat"[ZP] Sorry but nemesis can't teleport")
                
                return 
PLUGIN_HANDLED
            

Dude, a nemesis is still zombie.

PHP Code:
public client_connect(id)
{
    
g_used[id] = 0
    g_canztele
[id] = false
}

public 
client_disconnect(id)
{
    
g_used[id] = 0
    g_canztele
[id] = false

Why reseting twice?

PHP Code:
client_print(idprint_chat"[ZP] You have teleported %d of %d times"get_pcvar_num(g_ztele_max)) 
You forgot about one argument.

PHP Code:
g_canztele[id] = false 
You always set it to false, and you never use it (you never block teleporting)

PHP Code:
{
    if (!
is_user_alive(id))
    {
        
g_used[id] = 0
        g_canztele
[id] = false
        
        client_print
(idprint_chat"[ZP] You must be alive to use ztele!")
        
        return 
PLUGIN_HANDLED
    
}
    
    switch (
get_pcvar_num(g_ztele_mode))
    {
        case 
0:
        {
            
teleport_player(id)
            
client_print(idprint_chat"[ZP] You are now teleported to your spawn point.")
            
client_print(idprint_chat"[ZP] You have teleported %d of %d times"get_pcvar_num(g_ztele_max))
        }
        
        case 
1:
        {
            if (
zp_get_user_zombie(id))
            {
                
teleport_player(id)
                
client_print(idprint_chat"[ZP] You are now teleported away as zombie.")
                
client_print(idprint_chat"[ZP] You have teleported %d of %d times"get_pcvar_num(g_ztele_max))
            }
            
            else if (
zp_get_user_nemesis(id))
            {
                
g_used[id] = 0
                g_canztele
[id] = false
                
                client_print
(idprint_chat"[ZP] Sorry but nemesis can't teleport")
                
                return 
PLUGIN_HANDLED
            
}
        }
            
        case 
2:
        {
            if (!
zp_get_user_zombie(id))
            {
                
teleport_player(id)
                
client_print(idprint_chat"[ZP] You are now teleported away as survivor, to your spawn point.")
                
client_print(idprint_chat"[ZP] You have teleported %d of %d times"get_pcvar_num(g_ztele_max))
            }
        }
    }
    
    if (
get_pcvar_num(g_ztele_max) == g_used[id])
    {
        
g_canztele[id] = false
        client_print
(idprint_chat"[ZP] Sorry but you can't ztele anymore you already did %d of %d times"get_pcvar_num(g_ztele_max))
        
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE

Sooo bad coded...


This should be trashed.
SHUT UP! ><

There is nothing wrong with that... Damn.
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.

Last edited by Fry!; 01-01-2010 at 18:15.
Fry! is offline
Stixsmaster
Veteran Member
Join Date: May 2007
Location: I am all around you...I
Old 01-03-2010 , 02:22   Re: [ZP] Extra Server Addon : zTele
Reply With Quote #16

Question?

When you compile locally the original coding...does it give any errors?

If not...why try correcting that which is not needed?

---Stixsmaster

P.S. yes I am helping my good ole pal Fry!...reason being is we have a mutual respect for eachother + I know he enjoys me butting in...
__________________
Stixsmaster is offline
Send a message via AIM to Stixsmaster Send a message via MSN to Stixsmaster
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 01-03-2010 , 02:44   Re: [ZP] Extra Server Addon : zTele
Reply With Quote #17

Quote:
Originally Posted by Stixsmaster View Post
Question?

When you compile locally the original coding...does it give any errors?

If not...why try correcting that which is not needed?

---Stixsmaster

P.S. yes I am helping my good ole pal Fry!...reason being is we have a mutual respect for eachother + I know he enjoys me butting in...
Thanks! Stixs.. Yea, I had same question. It doesn't give any errors or either crushing server so it's not needed to change anything only add something new and optimize plugin.
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 01-03-2010 , 20:06   Re: [ZP] Extra Server Addon : zTele
Reply With Quote #18

Quote:
Originally Posted by Stixsmaster View Post
Question?

When you compile locally the original coding...does it give any errors?

If not...why try correcting that which is not needed?

---Stixsmaster

P.S. yes I am helping my good ole pal Fry!...reason being is we have a mutual respect for eachother + I know he enjoys me butting in...
Quote:
Originally Posted by Fry! View Post
Thanks! Stixs.. Yea, I had same question. It doesn't give any errors or either crushing server so it's not needed to change anything only add something new and optimize plugin.
Are you both retard? That code will bug like hell, and can be done in a much better way.
Why the fuck do you think there is an approval system? To discrimine beetwen shit plugins (like this one) and good plugins.

Anyway, in case you have the old code (which I don't know if you already changed it) it will get unapproved, so I'm wasting my precious time in here.
01101101 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-03-2010 , 21:44   Re: [ZP] Extra Server Addon : zTele
Reply With Quote #19

Quote:
Originally Posted by Stixsmaster View Post
Question?

When you compile locally the original coding...does it give any errors?

If not...why try correcting that which is not needed?

---Stixsmaster

P.S. yes I am helping my good ole pal Fry!...reason being is we have a mutual respect for eachother + I know he enjoys me butting in...
Quote:
Originally Posted by Fry! View Post
Thanks! Stixs.. Yea, I had same question. It doesn't give any errors or either crushing server so it's not needed to change anything only add something new and optimize plugin.
Really idiot to think like that. It's like you say "My code is badly coded but it works so I don't care what you say".

The problem is :

- You have to provide quality plugin ; if user puts numerous "badly coded" plugin it could have an unwanted effect. So, when you can optimize your plugin, do it. (at least the major optimisation ). A well coded plugin has more chance to generate less issues. Also it's in the rules. You are not there to do quantity.
- You are there to improve your coding skill ; if someone try to help you, don't push him because you "think" it's enough well coded. Take few seconds to review your code. It doesn't hurt and your plugin will be more readable/efficient.

Anyway, in your code there is no major optimization to do.

About the changes you could do, minor things :

- You see you repeat 3 times teleport_player(id) + 2 client_print() ; Create a function with that. Your code will be more neat and you will generate less code.
- Use MSG_PVS instead of MSG_BROADCAST ; no need to show something to player who doesn't look to the origin provided.
- Remove client_connect or client_disconnect ; using both at the same time is pointless.
- Use precache_sound, engfunc() uses a lot more code when precache_sound() does directly the job ; use always this one unless you know what you are doing. ( like wanting to precache in plugin_init for example )

Now about the respawn, you should try instead to let the engine spawning the player, because it will choose a free spawn point among all ; your code will be more safe.
__________________

Last edited by Arkshine; 01-03-2010 at 21:52.
Arkshine is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 01-04-2010 , 02:40   Re: [ZP] Extra Server Addon : zTele
Reply With Quote #20

Quote:
Originally Posted by Arkshine View Post
Really idiot to think like that. It's like you say "My code is badly coded but it works so I don't care what you say".

The problem is :

- You have to provide quality plugin ; if user puts numerous "badly coded" plugin it could have an unwanted effect. So, when you can optimize your plugin, do it. (at least the major optimisation ). A well coded plugin has more chance to generate less issues. Also it's in the rules. You are not there to do quantity.
- You are there to improve your coding skill ; if someone try to help you, don't push him because you "think" it's enough well coded. Take few seconds to review your code. It doesn't hurt and your plugin will be more readable/efficient.

Anyway, in your code there is no major optimization to do.

About the changes you could do, minor things :

- You see you repeat 3 times teleport_player(id) + 2 client_print() ; Create a function with that. Your code will be more neat and you will generate less code.
- Use MSG_PVS instead of MSG_BROADCAST ; no need to show something to player who doesn't look to the origin provided.
- Remove client_connect or client_disconnect ; using both at the same time is pointless.
- Use precache_sound, engfunc() uses a lot more code when precache_sound() does directly the job ; use always this one unless you know what you are doing. ( like wanting to precache in plugin_init for example )

Now about the respawn, you should try instead to let the engine spawning the player, because it will choose a free spawn point among all ; your code will be more safe.
Thanks Arkshine, at least someone can explain more than him, I appreciate that. I will try to do it ASAP.
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode