Raised This Month: $ Target: $400
 0% 

Can someone fix my Plugin?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ahmadgbg
Junior Member
Join Date: Mar 2005
Old 10-21-2006 , 11:35   Can someone fix my Plugin?
Reply With Quote #1

i tried to make a ww2 plugin that change the player skin and weapon skin plz help

here is the code:

#include <amxmodx>
#include <engine>
#include <cstrike>

new PLUGIN[]="WW2"
new AUTHOR[]="Enblad"
new VERSION[]="1.0"


public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

//Checks
register_event("ResetHUD", "newSpawn","b")
register_event("CurWeapon", "weaponChange","be","1=1")
}

//----------------------------------------------------------------------------------------------
public plugin_precache()
{
precache_model("models/v_shotgunns")
precache_model("models/p_shotgunns")
precache_model("models/player/soldier/Soldier.mdl")
}
//----------------------------------------------------------------------------------------------
public SoldierX_init()
{
giveGun(id)
switchmodel(id)
}
//----------------------------------------------------------------------------------------------
public giveGun(id)
{
if ( is_user_alive(id) ) {
give_item(id, "weapon_m4a1")
}
}

//----------------------------------------------------------------------------------------------
public switchmodel(id)
{
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
if (wpnid == CSW_XM1014) {
Entvars_Set_String(id, EV_SZ_viewmodel, "models/v_shotgunns")
Entvars_Set_String(id, EV_SZ_weaponmodel, "models/p_shotgunns")
}
}

//----------------------------------------------------------------------------------------------
public weaponChange(id)
{

new wpnid = read_data(2)
new clip = read_data(3)

if ( wpnid != CSW_XM1014 ) return

switchmodel(id)

if ( clip == 0 ) {
ReloadAmmo(id)
}
}

//----------------------------------------------------------------------------------------------
public changePlayer(id){
cs_set_user_model(id, "models/Soldier.mdl")
}

//----------------------------------------------------------------------------------------------
ahmadgbg is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-21-2006 , 11:39   Re: Can someone fix my Plugin?
Reply With Quote #2

Functions newSpawn and ReloadAmmo do not exist.
SoldierX_init is never being called.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
Old 10-21-2006, 11:42
ahmadgbg
This message has been deleted by ahmadgbg.
ahmadgbg
Junior Member
Join Date: Mar 2005
Old 10-21-2006 , 11:45   Re: Can someone fix my Plugin?
Reply With Quote #3

#include <amxmodx>
#include <engine>
#include <cstrike>

new PLUGIN[]="WW2"
new AUTHOR[]="Enblad"
new VERSION[]="1.0"


public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

//Checks
register_event("ResetHUD", "newSpawn","b")
register_event("CurWeapon", "weaponChange","be","1=1")
}

//----------------------------------------------------------------------------------------------
public plugin_precache()
{
precache_model("models/v_shotgunns")
precache_model("models/p_shotgunns")
precache_model("models/player/soldier/Soldier.mdl")
}
//----------------------------------------------------------------------------------------------
public init()
{
giveGun(id)
switchmodel(id)
}
//----------------------------------------------------------------------------------------------
public giveGun(id)
{
if ( is_user_alive(id) ) {
give_item(id, "weapon_m4a1")
}
}

//----------------------------------------------------------------------------------------------
public switchmodel(id)
{
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
if (wpnid == CSW_XM1014) {
Entvars_Set_String(id, EV_SZ_viewmodel, "models/v_shotgunns")
Entvars_Set_String(id, EV_SZ_weaponmodel, "models/p_shotgunns")
}
}

//----------------------------------------------------------------------------------------------
public weaponChange(id)
{

new wpnid = read_data(2)
new clip = read_data(3)

if ( wpnid != CSW_XM1014 ) return

switchmodel(id)

if ( clip == 0 ) {
ReloadAmmo(id)
}
}

//----------------------------------------------------------------------------------------------
public changePlayer(id){
cs_set_user_model(id, "models/Soldier.mdl")
}

//----------------------------------------------------------------------------------------------

i changed soldierx how should i do in newspawn and reloadammo?
ahmadgbg is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-21-2006 , 11:47   Re: Can someone fix my Plugin?
Reply With Quote #4

...
You changed SoldierX_init to init and now you think it is being called?????
__________________
EAT YOUR VEGGIES
Silencer123 is offline
ahmadgbg
Junior Member
Join Date: Mar 2005
Old 10-21-2006 , 11:48   Re: Can someone fix my Plugin?
Reply With Quote #5

i dont know what to do i am a beginner
ahmadgbg is offline
ahmadgbg
Junior Member
Join Date: Mar 2005
Old 10-21-2006 , 11:53   Re: Can someone fix my Plugin?
Reply With Quote #6

do you know whats the problem with my plugin?


#include <amxmodx>
#include <engine>
#include <cstrike>

new PLUGIN[]="WW2"
new AUTHOR[]="Enblad"
new VERSION[]="1.0"


public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

//Checks
register_event("ResetHUD", "newSpawn","b")
register_event("CurWeapon", "weaponChange","be","1=1")
}

//----------------------------------------------------------------------------------------------
public plugin_precache()
{
precache_model("models/v_shotgunns")
precache_model("models/p_shotgunns")
precache_model("models/player/soldier/Soldier.mdl")
}
//----------------------------------------------------------------------------------------------
public init()
{
giveGun(id)
switchmodel(id)
}
//----------------------------------------------------------------------------------------------
public giveGun(id)
{
if ( is_user_alive(id) ) {
give_item(id, "weapon_m4a1")
}
}

//----------------------------------------------------------------------------------------------
public switchmodel(id)
{
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
if (wpnid == CSW_XM1014) {
Entvars_Set_String(id, EV_SZ_viewmodel, "models/v_shotgunns")
Entvars_Set_String(id, EV_SZ_weaponmodel, "models/p_shotgunns")
}
}

//----------------------------------------------------------------------------------------------
public weaponChange(id)
{

new wpnid = read_data(2)
new clip = read_data(3)

if ( wpnid != CSW_XM1014 ) return

switchmodel(id)

if ( clip == 0 ) {
ReloadAmmo(id)
}
}

//----------------------------------------------------------------------------------------------
public changePlayer(id){
cs_set_user_model(id, "models/Soldier.mdl")
}

//----------------------------------------------------------------------------------------------
ahmadgbg is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-21-2006 , 11:57   Re: Can someone fix my Plugin?
Reply With Quote #7

Okay...
Try this. It will change all Players Model and hopefully the Shotgun Model.
Code:
#include <amxmodx> #include <engine> #include <cstrike> new VERSION[]="1.0" public plugin_init() {     register_plugin("WW2",VERSION,"Enblad")     register_event("ResetHUD","changePlayer","b")     register_event("CurWeapon","weaponChange","be","1=1") } public plugin_precache() {     precache_model("models/v_shotgunns")     precache_model("models/p_shotgunns")     precache_model("models/player/soldier/Soldier.mdl") } public switchmodel(id) {     new clip,ammo,wpnid=get_user_weapon(id,clip,ammo)     if(wpnid==CSW_XM1014)     {         entity_set_string(id,EV_SZ_viewmodel,"models/v_shotgunns")         entity_set_string(id,EV_SZ_weaponmodel,"models/p_shotgunns")     } } public weaponChange(id) {     new wpnid=read_data(2)     if(wpnid!=CSW_XM1014)     {         return     }     switchmodel(id) } public changePlayer(id) {     cs_set_user_model(id,"models/Soldier.mdl") }
__________________
EAT YOUR VEGGIES
Silencer123 is offline
ahmadgbg
Junior Member
Join Date: Mar 2005
Old 10-21-2006 , 12:18   Re: Can someone fix my Plugin?
Reply With Quote #8

cant you do that ct get one skin and t get an other skin
same with the weapon?
ahmadgbg is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 10-21-2006 , 12:39   Re: Can someone fix my Plugin?
Reply With Quote #9

Ironic how silencer has "Fakemeta GOOD, Engine BAD" in his sig yet gave you a script with engine in it. tsk tsk tsk. Practice what you preach I say.

Code:
#include <amxmodx> #include <fakemeta> #include <cstrike> new VERSION[]="1.0" public plugin_precache()     {     precache_model("models/skins/auto/v_auto.mdl")     precache_model("models/models/skins/auto/p_auto.mdl")     precache_model("tmodelhere")//place ur t custom model here     precache_model("ctmodelhere")//ditto } public plugin_init()     {     register_plugin("WW2",VERSION,"Enblad")     register_event("ResetHUD","changePlayer","be")     register_event("CurWeapon","weaponChange","be","1=1") } public weaponChange(id)//this function is called when a player changes their weapon     {     new wpnid = read_data(2)//find what is the players current weapon         if(wpnid == CSW_XM1014)// make sure the current weapon is the shotgun         {         //change models using FAKEMETA         set_pev(id, pev_viewmodel2, "models/skins/auto/v_auto.mdl")         set_pev(id, pev_weaponmodel2, "models/skins/auto/p_auto.mdl")           }     return PLUGIN_CONTINUE } public changePlayer(id)//this function is called on every reset hud.     {     new CsTeams:iTeam = cs_get_user_team(id)// get the team of the player to change their model by team         switch(iTeam)     {         case CS_TEAM_T://player is on terrorist team         {             cs_set_user_model(id, "tmodelhere")//terrorist custom model         }         case CS_TEAM_CT://player is on ct team         {             if(!cs_get_user_vip(id))//make sure player is not vip should the map be a vip map                 {                 cs_set_user_model(id, "ctmodelhere")//ct custom model             }         }     }     return PLUGIN_CONTINUE }

Last edited by organizedKaoS; 10-21-2006 at 12:44.
organizedKaoS is offline
ahmadgbg
Junior Member
Join Date: Mar 2005
Old 10-21-2006 , 13:08   Re: Can someone fix my Plugin?
Reply With Quote #10

i want it like this, you drop all you weapons without the shotgun and i want it to be diffrent weapon skins in each team and want the player skin. plz if you can do it tell me and when i have fake..... do i have to download it or something?

Last edited by ahmadgbg; 10-21-2006 at 13:29.
ahmadgbg 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 04:55.


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