AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need help with scrore plugin (https://forums.alliedmods.net/showthread.php?t=55637)

[X]-RayCat 05-26-2007 14:08

Need help with scrore plugin
 
Code:

#include <amxmodx>
#include <amxmisc>
 
#define Plugin "Team Score"
#define Version "1.0"
#define Author "Doombringer"
 
new team_wins[2]

public plugin_init()
{
 register_plugin(Plugin, Version, Author)
 
 register_event("TeamScore", "team_score", "a")
 register_event("HLTV", "new_round", "a", "1=0", "2=0")
}
public team_score()
{
 new team[2]
 read_data(1, team, 1)
 
 if(team[0] == 'C')
  team_wins[0] = read_data(2)
 
 else if(team[0] == 'T')
  team_wins[1] = read_data(2)
 
 return PLUGIN_CONTINUE
}
public new_round()
{
 set_hudmessage(255, 255, 255, 0.01, 0.18, 0, 6.0, 6.0)
 show_hudmessage(0, "CT %d / TS %d", team_wins[0], team_wins[1])
}

I got this plugin. How can i make total rounds to 6 then do something? Like when 6 total rounds have been played?

[X]-RayCat 05-26-2007 14:44

Re: Need help with scrore plugin
 
Quote:

Originally Posted by regalis (Post 482171)
First i want a "thank you" for my work on this thread:
http://forums.alliedmods.net/showthread.php?t=54919

greetz regalis

What that suppose to mean? But thanks anyways..

[X]-RayCat 05-26-2007 15:14

Re: Need help with scrore plugin
 
Quote:

Originally Posted by regalis (Post 482182)
I have coded a plugin for you and you never said "thank you"...that is not nice!
There is another thread from you where someone has coded something for you and you never replied!
Is that normal where you live? I don't think so!
Please be nice to the people who are trying to help you....

Nevertheless here you go:
Code:

#include <amxmodx>
#include <amxmisc>
 
#define Plugin "Team Score"
#define Version "1.0"
#define Author "Doombringer"
 
new team_wins[2]
 
 
public plugin_init()
{
 register_plugin(Plugin, Version, Author)
 
 register_event("TeamScore", "team_score", "a")
 register_event("HLTV", "new_round", "a", "1=0", "2=0")
}
 
public team_score()
{
 new team[2]
 read_data(1, team, 1)
 
 if(team[0] == 'C')
  team_wins[0] = read_data(2)
 
 else if(team[0] == 'T')
  team_wins[1] = read_data(2)
 
 if(team_wins[0]+team_wins[1] == 6)
 {
    // 6 rounds played...do something
    // maybe changelevel or what ever!?   
 }
 return PLUGIN_CONTINUE
}
 
public new_round()
{
 set_hudmessage(255, 255, 255, 0.01, 0.18, 0, 6.0, 6.0)
 show_hudmessage(0, "CT %d / TS %d", team_wins[0], team_wins[1])
}

Btw.: +Karma would be nice! :P

t4t, i gave you karma with my name on it, isnt that enought? ^__^
(Cant give karma atm) Is it possible if score is draw to restart round and set round limit to 3 and get winner of those 3 rounds?

[X]-RayCat 05-26-2007 15:33

Re: Need help with scrore plugin
 
Quote:

Originally Posted by regalis (Post 482191)
That could be true...can't remember if or if not :P
Good that you don't start to flame...that makes you simpatico ;)

So is my suggestion possible to make? :P
Nvm, i will set that to 6 so draw isnt possible. :P

[X]-RayCat 05-26-2007 16:32

Re: Need help with scrore plugin
 
Quote:

Originally Posted by regalis (Post 482182)
I have coded a plugin for you and you never said "thank you"...that is not nice!
There is another thread from you where someone has coded something for you and you never replied!
Is that normal where you live? I don't think so!
Please be nice to the people who are trying to help you....

Nevertheless here you go:
Code:

#include <amxmodx>
#include <amxmisc>
 
#define Plugin "Team Score"
#define Version "1.0"
#define Author "Doombringer"
 
new team_wins[2]
 
 
public plugin_init()
{
 register_plugin(Plugin, Version, Author)
 
 register_event("TeamScore", "team_score", "a")
 register_event("HLTV", "new_round", "a", "1=0", "2=0")
}
 
public team_score()
{
 new team[2]
 read_data(1, team, 1)
 
 if(team[0] == 'C')
  team_wins[0] = read_data(2)
 
 else if(team[0] == 'T')
  team_wins[1] = read_data(2)
 
 if(team_wins[0]+team_wins[1] == 6)
 {
    // 6 rounds played...do something
    // maybe changelevel or what ever!?   
 }
 return PLUGIN_CONTINUE
}
 
public new_round()
{
 set_hudmessage(255, 255, 255, 0.01, 0.18, 0, 6.0, 6.0)
 show_hudmessage(0, "CT %d / TS %d", team_wins[0], team_wins[1])
}

Btw.: +Karma would be nice! :P

Didnt work... :|

[X]-RayCat 05-26-2007 17:29

Re: Need help with scrore plugin
 
Quote:

Originally Posted by regalis (Post 482225)
What didn't work?
Post your code what you have tried to do...

I made set_task to other public..

[X]-RayCat 05-26-2007 18:24

Re: Need help with scrore plugin
 
Quote:

Originally Posted by regalis (Post 482234)
set_task(1.0, "otherpublic") !?

yes.. :grrr:

[X]-RayCat 05-29-2007 16:43

Re: Need help with scrore plugin
 
I gave you both +karma. Deviance for that first plugin and regalis for this tolalrounds thing. And now i need to know how to minus and plus one score. :up:

EDIT:
Code:

team_wins[0]+=1
team_wins[0]-=1

Would that do the job? :)

v3x 05-29-2007 18:12

Re: Need help with scrore plugin
 
Quote:

Originally Posted by [X]-RayCat (Post 483448)
I gave you both +karma. Deviance for that first plugin and regalis for this tolalrounds thing. And now i need to know how to minus and plus one score. :up:

EDIT:
Code:

team_wins[0]+=1
team_wins[0]-=1

Would that do the job? :)

PHP Code:

team_wins[0]++
team_wins[0]-- 


[X]-RayCat 05-30-2007 04:41

Re: Need help with scrore plugin
 
Quote:

Originally Posted by v3x (Post 483487)
PHP Code:

team_wins[0]++
team_wins[0]-- 


So that would increase/decrease 1 value? But wouldnt it be different with increasing/decreasing like 10 value?

PS: Welcome back. :)


All times are GMT -4. The time now is 10:42.

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