Raised This Month: $ Target: $400
 0% 

first script idea?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarlD
Senior Member
Join Date: Aug 2004
Old 03-10-2005 , 16:23   first script idea?
Reply With Quote #1

I got this idea for a frist script something that would start me up on the scripting community. i've got the idea but i have no idea on how to start it.

basicly i want to make it so that at each new round players are droped down at 1hp and they are given a scout with full ammo. basicly a one shot kill server. here is what i got so far...

Code:
/*
One shot kill, for Amx Mod X

Created by DarlD
*/
#include <amxmodx>
#include <fun>
#include <cstrike>

public plugin_init() // im starting my plugin here
{
    register_plugin("One shot kill","0.1","DarlD")
thats as far as i could go

EDIT: i think i made some progress but im almost sure i made errors!

Code:
/*
One shot kill, for Amx Mod X

Created by DarlD
*/
#include <amxmodx>
#include <fun>
#include <cstrike>

public plugin_init() // im starting my plugin here
{
    register_plugin("One shot kill","0.1","DarlD")
    register_cvar("amx_oneshot","1","1","1","1",1")
}

set_user_health(1,1)
give_item(32,weapon_scout)
give_item(32,ammo_scout)
DarlD is offline
Send a message via MSN to DarlD
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-10-2005 , 22:12  
Reply With Quote #2

Code:
/* One shot kill, for Amx Mod X Created by DarlD */ #include <amxmodx> #include <fun> public plugin_init() // im starting my plugin here {     register_plugin("One shot kill","0.1","DarlD")     register_cvar("amx_oneshot","1")     register_event("ResetHUD","event_resethud","b"); } public event_resethud(id) { // when a user's HUD is reset    if(is_user_connected(id)) { // make sure they are connected (just to be sure)       // most of the time ResetHUD is called when       // a user spawns, but it can be called other times.       // when it IS called when they spawn, they are still       // technically dead. so we wait one tenth of a second       // to see if they alive, and if so it means they just       // spawned, which is when we want to do this.       set_task(0.1,"dostuff",id)    } } public dostuff(id) {    // if user is alive    if(is_user_alive(id)) {       set_user_health(id,1)       give_item(id,"weapon_scout")       give_item(id,"ammo_scout")    } }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
manorastroman
Senior Member
Join Date: Oct 2004
Old 03-10-2005 , 22:15  
Reply With Quote #3

is there a way that you can mask how much health the client really has?
__________________
manorastroman is offline
Send a message via AIM to manorastroman Send a message via MSN to manorastroman Send a message via Skype™ to manorastroman
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 03-11-2005 , 00:21  
Reply With Quote #4

LMAO I made a plugin exactly like this , I just didn't release it... If you want you can Private Message me and I'll show you the code with descriptions.
Peli is offline
Send a message via MSN to Peli
DarlD
Senior Member
Join Date: Aug 2004
Old 03-11-2005 , 00:50  
Reply With Quote #5

woha i was way off thanks man. i guess i release it under your name though. now i understand how it works a little better.

edit: i've tried to add the cs_set_user_money command in the script because if the player is able to buy other weapons it would kinda suck. so heres what i did and i get a compile error of course. where did i make an error?

Code:
/* One shot kill, for Amx Mod X Created by DarlD */ #include <amxmodx> #inculde <cstrike> #include <fun> public plugin_init() // im starting my plugin here {     register_plugin("One shot kill","0.1","DarlD")     register_cvar("amx_oneshot","1")     register_event("ResetHUD","event_resethud","b"); } public event_resethud(id) { // when a user's HUD is reset    if(is_user_connected(id)) { // make sure they are connected (just to be sure) }    cs_set_user_money(id,"0","0") {       // most of the time ResetHUD is called when       // a user spawns, but it can be called other times.       // when it IS called when they spawn, they are still       // technically dead. so we wait one tenth of a second       // to see if they alive, and if so it means they just       // spawned, which is when we want to do this.       set_task(0.1,"dostuff",id)    } } public dostuff(id) {    // if user is alive    if(is_user_alive(id)) {       set_user_health(id,1)       give_item(id,"weapon_scout")       give_item(id,"ammo_scout")    } }
DarlD is offline
Send a message via MSN to DarlD
DarlD
Senior Member
Join Date: Aug 2004
Old 03-11-2005 , 14:06  
Reply With Quote #6

could any one help me?
DarlD is offline
Send a message via MSN to DarlD
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 03-11-2005 , 15:06  
Reply With Quote #7

Look in the include/*.inc files for proper native syntax... (like cs_set_user_money())
(hint: cs_set_user_money(player, 0))
Johnny got his gun is offline
DarlD
Senior Member
Join Date: Aug 2004
Old 03-11-2005 , 15:18  
Reply With Quote #8

when i did that it gave me loads of errors :S

Code:
      set_task(0.1,"dostuff",id)    } } public dostuff(id) {    // if user is alive    if(is_user_alive(id)) {       set_user_health(id,1)       cs_set_user_money(player,"0")       give_item(id,"weapon_scout")       give_item(id,"ammo_scout")    } }

i just added cs_set_user_money and it doesnt work :S i added cstrike in the inculde though still gives an error
DarlD is offline
Send a message via MSN to DarlD
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-11-2005 , 16:16  
Reply With Quote #9

Show the whole code, please .
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-11-2005 , 21:02  
Reply With Quote #10

Code:
/* One shot kill, for Amx Mod X Created by DarlD */ #include <amxmodx> #include <fun> public plugin_init() // im starting my plugin here {     register_plugin("One shot kill","0.1","DarlD")     register_cvar("amx_oneshot","1")     register_event("ResetHUD","event_resethud","b"); } public event_resethud(id) { // when a user's HUD is reset    if(is_user_connected(id)) { // make sure they are connected (just to be sure)       // most of the time ResetHUD is called when       // a user spawns, but it can be called other times.       // when it IS called when they spawn, they are still       // technically dead. so we wait one tenth of a second       // to see if they alive, and if so it means they just       // spawned, which is when we want to do this.       set_task(0.1,"dostuff",id)    } } public dostuff(id) {    // if user is alive    if(is_user_alive(id)) {       set_user_health(id,1)       give_item(id,"weapon_scout")       give_item(id,"ammo_scout")       cs_set_user_money(id,0);    } }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 14:02.


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