Raised This Month: $51 Target: $400
 12% 

A little help with a custom vip model changer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The Gaming Guy
Junior Member
Join Date: Dec 2015
Old 01-04-2016 , 01:14   A little help with a custom vip model changer
Reply With Quote #1

Here is my code :
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init() {
    
register_plugin("Custom Vip Model","1.0"," The Gaming Guy")
    
register_event("ResetHUD""resetModel""b")
}

public 
current_model(id) {
    new 
de_dust[8] = "de_dust"
    
new map[33]
    new 
de_dust2[9] = "de_dust2"
    
get_mapname(map,32)
   }
   public 
model(id){
    if (
strcmp map de_dust ) ) {

        public 
plugin_precache(id) {
precache_model("models/player/de_dust/vip_ct/adm_ct.mdl")
precache_model("models/player/de_dust/vip_te/adm_te.mdl")
return 
PLUGIN_CONTINUE
}

public 
resetModel(idlevelcid) {
if (
get_user_flags(id) & ADMIN_KICK) {
cs_reset_user_model(id)
new 
CsTeams:userTeam cs_get_user_team(id)
if (
userTeam == CS_TEAM_T) {
///cs_set_user_model(id, "foldername_te")
cs_set_user_model(id"de_dust/vip_te")
}
else if(
userTeam == CS_TEAM_CT) {
///cs_set_user_model(id, "foldername_ct")
cs_set_user_model(id"de_dust/vip_ct")
}
}
else if (
strcmp(map ,de_dust2) {

public 
plugin_precache() {
precache_model("models/player/de_dust2/vip_ct/adm_ct.mdl")
precache_model("models/player/de_dust2/vip_te/adm_te.mdl")
return 
PLUGIN_CONTINUE

public resetModel(idlevelcid) {
if (
get_user_flags(id) & ADMIN_KICK) {
cs_reset_user_model(id)
new 
CsTeams:userTeam cs_get_user_team(id)
if (
userTeam == CS_TEAM_T) {
///cs_set_user_model(id, "foldername_te")
cs_set_user_model(id"de_dust2/vip_te")
}
else if(
userTeam == CS_TEAM_CT) {
///cs_set_user_model(id, "foldername_ct")
cs_set_user_model(id"de_dust2/vip_ct")
}

}
}
 
return 
PLUGIN_CONTINUE
}
}
    return 
PLUGIN_CONTINUE

What I am trying to do is to create a plugin to change models per map change. In the above eample I have added two maps (de_dust , de_dust2) But I get errors :
PHP Code:
Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c1997-2006 ITB CompuPhaseAMX Mod X Team

Warning
Symbol is assigned a value that is never used"de_dust2" on line 15
Warning
Symbol is assigned a value that is never used"de_dust" on line 15
Error
Undefined symbol "map" on line 17
Error
Invalid expressionassumed zero on line 19
Error
: Function "plugin_precache" is not implemented on line 19
Warning
Unreachable code on line 25
Warning
Loose indentation on line 25
Error
Invalid expressionassumed zero on line 25
Error
Undefined symbol "resetModel" on line 25
Error
Undefined symbol "cid" on line 25
Error
Too many error messages on one line on line 25

Compilation aborted
.
7 Errors.
Could not locate output file C:\Users\kdubey\Desktop\Untitled.amx (compile failed). 
Please help !
The Gaming Guy is offline
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 01-04-2016 , 02:22   Re: A little help with a custom vip model changer
Reply With Quote #2

Indent the code
Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
The Gaming Guy
Junior Member
Join Date: Dec 2015
Old 01-04-2016 , 03:12   Re: A little help with a custom vip model changer
Reply With Quote #3

Quote:
Originally Posted by Chihuahuax View Post
Indent the code
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init() {
    register_plugin("Custom Vip Model","1.0"," The Gaming Guy")
    register_event("ResetHUD", "resetModel", "b")
}

public current_model(id) {
    new de_dust[8] = "de_dust"
    new map[33]
    new de_dust2[9] = "de_dust2"
    get_mapname(map,32)
   }
public model(id){
    if (strcmp ( map , de_dust ) ) {

public plugin_precache(id) {
	precache_model("models/player/de_dust/vip_ct/adm_ct.mdl")
	precache_model("models/player/de_dust/vip_te/adm_te.mdl")
	return PLUGIN_CONTINUE
}

public resetModel(id, level, cid) {
	if (get_user_flags(id) & ADMIN_KICK) {
		cs_reset_user_model(id)
		new CsTeams:userTeam = cs_get_user_team(id)
	if (userTeam == CS_TEAM_T) {
			///cs_set_user_model(id, "foldername_te")
			cs_set_user_model(id, "de_dust/vip_te")
	}
	else if(userTeam == CS_TEAM_CT) {
		///cs_set_user_model(id, "foldername_ct")
		cs_set_user_model(id, "de_dust/vip_ct")
}
}
	else if (strcmp(map ,de_dust2) {

public plugin_precache() {
	precache_model("models/player/de_dust2/vip_ct/adm_ct.mdl")
	precache_model("models/player/de_dust2/vip_te/adm_te.mdl")
	return PLUGIN_CONTINUE

public resetModel(id, level, cid) {
	if (get_user_flags(id) & ADMIN_KICK) {
		cs_reset_user_model(id)
		new CsTeams:userTeam = cs_get_user_team(id)
		if (userTeam == CS_TEAM_T) {
			///cs_set_user_model(id, "foldername_te")
			cs_set_user_model(id, "de_dust2/vip_te")
}
	else if(userTeam == CS_TEAM_CT) {
		///cs_set_user_model(id, "foldername_ct")
		cs_set_user_model(id, "de_dust2/vip_ct")
}

}
}
 
return PLUGIN_CONTINUE
}
}
    return PLUGIN_CONTINUE
}
You mean this ?
The Gaming Guy 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:48.


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