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

What's wrong?


Post New Thread Reply   
 
Thread Tools Display Modes
Vechta
Veteran Member
Join Date: Jun 2010
Old 10-15-2010 , 06:02   Re: What's wrong?
Reply With Quote #21

Quote:
Originally Posted by fysiks View Post
I have ZP and I was unable to find anything about a function called "zp_round".
Isnt it

PHP Code:
zp_round_started(Gamemodeid
?
Vechta is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 10-16-2010 , 11:07   Re: What's wrong?
Reply With Quote #22

Agreed
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
surfhope
Member
Join Date: Aug 2010
Location: Austria
Old 12-30-2010 , 16:01   Re: What's wrong?
Reply With Quote #23

^^


PHP Code:
/* Autoslay by Hope 
Will slay Nem or Sur in Nem/Surv. Mode when 3 rounds after the last same mode haven't past*/
#include <amxmodx>
#include <zombieplague>
#include <fakemeta>
#include <cstrike>
 
#define PLUGIN "[ZP] Auto Slay"
#define VERSION "1.0"
#define AUTHOR "Hope"
 
new i=1;
new 
pcvar;
new 
round;
 
public 
plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR);
 
pcvar register_cvar("zp_auto_slay""1")  // Enable/Disable Plugin
 
round register_cvar("zp_rounds""3"// How many rounds should be no nem/sur after the last!
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 
register_clcmd("say /zpround""Sayzpround")
 
register_clcmd("say_team /zpround""Sayzpround")
}
public 
plugin_cfg()
{
 
// Plugin is disabled
 
if (!get_pcvar_num(pcvar))
 return
}
 
 
public 
Sayzpround()

 
         if (
round)
         {
          
client_print(0,print_chat,"%i rounds have pasted, after the last Nemesis/Surivior! You can't make Nemesis/Surivior next round!"i)
         }else
          
client_print(0,print_chat,"%i rounds have pasted, after the last Nemesis/Surivior! You can make Nemesis/Surivior next round!"i)
        
 
 
}
 
 
public 
zp_round_started(gamemodeid)
{
 
  if(
gamemode == MODE_SURVIVOR)
  {
 
 
 
          if (
round
         {
           
i=1
           
static name[32]
           
get_user_name (idname32)
 
      
client_print(0,print_chat,"%s has been slayed for making Survivor to early!"name)
           
server_cmd("amx_slay #%d"get_user_userid(id))
         
 
          }
  } 
 
 
  if(
gamemode == MODE_NEMESIS)
 
   {
           if (
round)
          {
          
i=1;
          static 
name[32]
          
get_user_name (idname32)
 
          
client_print(0,print_chat,"%s has been slayed for making Nemesis to early!"name)
     
server_cmd("amx_slay #%d"get_user_userid(id))
        
 
          }
   }
 
 
  if(
gamemode == MODE_INFECTION)
 {
i++
 }
 
  if(
gamemode == MODE_SWARM)
 {
i++
 }
 
  if(
gamemode == MODE_PLAGUE)
 {
i++
 }
 
 
  if(
gamemode == MODE_MULTI)
 {
i++
 }
 

A question, what's wrong with my server cmd? I get there a stupid error....

Also here:
PHP Code:
 if (round)
         {
          
client_print(0,print_chat,"%i rounds have pasted, after the last Nemesis/Surivior! You can't make Nemesis/Surivior next round!"i)
         }else
          
client_print(0,print_chat,"%i rounds have pasted, after the last Nemesis/Surivior! You can make Nemesis/Surivior next round!"i
I found a problem.

It displays both messages with a different i....

1. Why does it display both messages and
2. Why is there a different i
__________________
surfhope is offline
Send a message via Skype™ to surfhope
surfhope
Member
Join Date: Aug 2010
Location: Austria
Old 02-14-2011 , 17:02   Re: What's wrong?
Reply With Quote #24

Noone who wanna help me? ;(
__________________
surfhope is offline
Send a message via Skype™ to surfhope
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-14-2011 , 19:21   Re: What's wrong?
Reply With Quote #25

0. Change server_cmd() to userkill().
1. It's not possible for it to show both messages at the same time.
2. It's your code. You should ask yourself. What is "i" anyways???
__________________
fysiks is online now
surfhope
Member
Join Date: Aug 2010
Location: Austria
Old 02-15-2011 , 14:49   Re: What's wrong?
Reply With Quote #26

Quote:
Originally Posted by fysiks View Post
0. Change server_cmd() to userkill().
1. It's not possible for it to show both messages at the same time.
2. It's your code. You should ask yourself. What is "i" anyways???
0. Thx for that
1. I think I've found the mistake...
2. i is the counter var, which counts how many rounds have past since the last time someone was a nemesis/survivor
__________________

Last edited by surfhope; 02-15-2011 at 14:56.
surfhope is offline
Send a message via Skype™ to surfhope
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-15-2011 , 23:17   Re: What's wrong?
Reply With Quote #27

The variable "round" is not a number of rounds. It is a pointer (address) to the cvar and not the actual value of the cvar.

You need to use get_pcvar_num(round) to get the actual value of the cvar "zp_rounds" (3 in this case).

EDIT: Also, you need to include zombieplague.inc last because it uses fakemeta functions.

This code doesn't do anything btw:
Code:
public plugin_cfg() 
{ 
 // Plugin is disabled 
 if (!get_pcvar_num(pcvar)) 
 return 
}
__________________

Last edited by fysiks; 02-15-2011 at 23:47.
fysiks is online now
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 02-17-2011 , 10:46   Re: What's wrong?
Reply With Quote #28

[quote='Exolent[jNr];1315604']Don't use
Quote:
tags for code.

Your code is very bad. Please learn more before trying to code.
If you dont trying to code you dont learn something to
.Dare Devil. is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 02-17-2011 , 11:00   Re: What's wrong?
Reply With Quote #29

Quote:
Originally Posted by fysiks View Post
Why do people never answer my questions!?!?!?!?!?
I had to laugh until I cry.
Quote:
Originally Posted by fysiks View Post
Readability is a huge part of coding.
Correct, so please made it surfhope.
__________________

Working on:
nothing
schmurgel1983 is offline
Conan1018
Member
Join Date: Oct 2010
Old 02-17-2011 , 17:34   Re: What's wrong?
Reply With Quote #30

Quote:
Originally Posted by fysiks View Post
Why do people never answer my questions!?!?!?!?!?
lol fysiks hahahhahahahaha
that was so funny
Conan1018 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 19:39.


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