Ok, so I recieved some help modding this script for amxx a long while ago and with the newest update when a user picks up an awp the server crashes ...
Any help would be appreciated. Thanks.
Here is the current code
Code:
/* AMXX Mod script.
*
* This file is provided as is (no warranties).
* A better awp restriction for cs (this works for 1.6)
* This plugin changes a players awp to a scout.
* It basically burries the player 2000 units down, drops the awp,
* gives a scout/ammo and puts them back.
*
* Version:
* 0.2 - Updated for AMXX
* - Code shortened and cleaned
*
* Install:
* ---------------
* Add to your awp2scout.amx to your plugins.ini and add the amx_awp2scout cvar to your amxx.cfg
*
* COMMANDS:
* ---------------
* amx_awp2scout (1|0) 1= On 0= Off
*/
#include <amxmodx>
#include <amxmisc>
#include <fun>
public check_awp(id) {
if (get_cvar_num("amx_awp2scout")!=1)
{
return PLUGIN_CONTINUE
}else{
new parm[1]
parm[0] = id
set_task(0.1, "drop_awp", id, parm, 1)
}
return PLUGIN_CONTINUE
}
public drop_awp (parm[]) {
new id = parm[0]
new origin[3]
get_user_origin(id, origin, 0)
origin[2] -= 2000
set_user_origin(id, origin)
engclient_cmd(id, "drop", "weapon_awp")
give_item(id, "weapon_scout")
give_item(id, "ammo_762nato")
origin[2] += 2005
set_user_origin(id, origin)
}
public plugin_init() {
register_plugin("Awp2Scout", "0.2", "[-3LH-]Geezus")
register_event("WeapPickup", "check_awp", "b","1=18")
register_cvar("amx_awp2scout", "1")
return PLUGIN_CONTINUE
}