AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   A little help with a custom vip model changer (https://forums.alliedmods.net/showthread.php?t=277171)

The Gaming Guy 01-04-2016 01:14

A little help with a custom vip model changer
 
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 !

Chihuahuax 01-04-2016 02:22

Re: A little help with a custom vip model changer
 
Indent the code

The Gaming Guy 01-04-2016 03:12

Re: A little help with a custom vip model changer
 
Quote:

Originally Posted by Chihuahuax (Post 2379755)
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 ?


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

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