AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   CS 1.6 objective reward / punishment idea needing help (https://forums.alliedmods.net/showthread.php?t=57928)

Zaseishin 07-14-2007 17:56

CS 1.6 objective reward / punishment idea needing help
 
Hi, hoping someone can help me out here. I cannot script but I am able to edit existing things fairly well. I see a lot off heavy punishment scripts for not doing objectives in cs but not so many to give rewards.

What I'm trying to do is give some special things for hostage and vip maps. Nothing big, mind you. Just a little something extra to make things more "worth it" to the players.

For hostage maps, I want killing a hostage to give server notification and subtract a kill/point from the offender. This should lessen Ts and CTs from killing hostages to win rounds. Also, I want for every hostage a player rescues he gains one kill/point.

For VIP maps I'd like the VIP to gain 3 kills/points for escaping (like for bombing and defusing).

So far, I have been able to modify Olo's old hostage_events plugin to do a little of this but here are the issues I lack the skill to fix:

1. When a hostage is killed the player's edited score is not changed till next round instead of instantly. (current fix is a text message to warn the player of the update next round)

2. I cannot figure out how to add kills to the rescuing player's score.

3. VIPs I am totally lost on.

Any assistance would be helpful. I am not hoping for someone to write this for me but any tips on how to proceed would be most useful.

Here is what I have so far:

Code:

/* AMX Mod script.
*
* Plugin to enable by menu from Stats Settings Plugin.
* (c) Copyright 2002-2003, OLO
* This file is provided as is (no warranties).
*
*/
#include <amxmod>
#define STS_CHNL 6
#define STS_FLAG27 27 //Hostage kill
#define STS_FLAG28 28 //Hostage rescue
new hos_owner
new Float:lannounce
new hostage_msg[5][64] = {
"The T's prevented the CT's to rescue the hostages",
"The CT's rescued all hostages",
"%s killed a hostage.",
"Hostage rescued by %s.",
"%s grabbed a hostage."
}
public show_msg(msg[]){
    set_hudmessage(200, 100, 0, 0.01, 0.91, 2, 0.02, 6.0, 0.01, 0.1, 1)
    show_hudmessage(0,msg)
}
public host_killed(id){
    if (!(get_user_flags(0,STS_CHNL)&(1<<STS_FLAG27)))
        return
    new name[32], message[128]
    get_user_name(id,name,31)
    new len = format(message,127,hostage_msg[2],name)
    play_sound("radio/hosdown")
    set_task(0.1,"show_msg",0,message,len+1)
    new user_frags = get_user_frags(id)
    set_user_frags(id,(user_frags - 1))
    client_print(id,print_chat,"[AMX]: -1 kill for hostage loss. Updated next round.")
}
public host_res(){
    if (!(get_user_flags(0,STS_CHNL)&(1<<STS_FLAG28)))
        return
    if (lannounce < get_gametime()){
        new name[32], message[128]
        get_user_name(hos_owner,name,31)
        new len = format(message,127,hostage_msg[3],name)
        set_task(0.1,"show_msg",0,message,len+1)
        new user_frags = get_user_frags(hos_owner)
        set_user_frags(hos_owner,(user_frags + 1))
    }
}
public play_sound(sound[]){
    new players[32], pnum
    get_players(players, pnum, "c")
    new i
    for (i=0; i<pnum; i++){
        if (is_user_connecting(players[i]))
            continue
        client_cmd(players[i], "spk %s", sound)
    }
}
public plugin_init(){
    register_plugin("Hostage Events","0.9.3","default")
    register_event("TextMsg","host_killed","b","2&#Killed_Hostage")
    register_event("SendAudio","host_res","a","2&%!MRAD_rescued")
    server_cmd("amx_addoption ^"Hostage kill^" %d %d",STS_CHNL,STS_FLAG27)
    server_cmd("amx_addoption ^"Hostage rescue^" %d %d",STS_CHNL,STS_FLAG28)
    new mapname[4]
    get_mapname(mapname,3)
    if (!equali(mapname,"cs_",3))
        pause("a")
    return PLUGIN_CONTINUE
}

I don't actually want the message in the rescue part but I am leaving it in for now so I can at least know part of that section is working.


All times are GMT -4. The time now is 21:32.

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