AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   amx_fake amx_reveal (https://forums.alliedmods.net/showthread.php?t=5362)

_Rustynails_ 08-29-2004 22:25

amx_fake amx_reveal
 
Just wanted to check if everything would run fine.
I got no errors when compiling. Just want to check if you see anything wrong?

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> public plugin_init() {   register_plugin("AMX-TEAM-FAKE","0.1","Rustynails")   register_clcmd("amx_team_fake","do_fake",ADMIN_BAN)   register_plugin("AMX-TEAM-REVEAL","0.1","Rustynails")   register_clcmd("amx_team_reveal","do_reveal",ADMIN_BAN) } public do_fake(id) {   new user[32], uid   read_argv(1,user,31)   uid = find_player("bhl",user)   if (access(id,ADMIN_BAN)) {     if (uid) {       if (!access(uid,ADMIN_IMMUNITY)) {         if (get_user_team(uid) == 1) {           cs_set_user_model(uid,"6")           console_print(id,"Fake changed player's team. They now look like a CT.")           } else if (get_user_team(uid) == 2) {           cs_set_user_model(uid,"3")           console_print(id,"Fake changed player's team. They now look like a T.")           } else if (get_user_team(uid) == 3) {           console_print(id,"User is currently a spectator. Cannot fake change their team.")         }         } else {         console_print(id,"Cannot use this command on this player. He/she is immune.")       }       } else {       console_print(id,"Could not recognize that user.")     }     } else {     console_print(id,"You do not have enough access to use this command.")   }   return PLUGIN_HANDLED } public do_reveal(id) {   new user[32], uid   read_argv(1,user,31)   uid = find_player("bhl",user)   if (access(id,ADMIN_BAN)) {     if (uid) {       if (!access(uid,ADMIN_IMMUNITY)) {         if (get_user_team(uid) == 1) {           if (cs_get_user_model(uid,"5",31)) {             cs_set_user_model(id,"1")             console_print(id,"Revealed player.")             } else if (cs_get_user_model(uid,"6",32)) {             cs_set_user_model(id,"1")             console_print(id,"Revealed player.")             } else if (cs_get_user_model(uid,"7",32)) {             cs_set_user_model(id,"1")             console_print(id,"Revealed player.")             } else if (cs_get_user_model(uid,"8",32)) {             cs_set_user_model(id,"1")             console_print(id,"Revealed player.")             } else {             console_print(id,"That user was not faking teams.")           }           } else if (get_user_team(uid) == 2) {           if (cs_get_user_model(uid,"1",32)) {             cs_set_user_model(id,"5")             console_print(id,"Revealed player.")             } else if (cs_get_user_model(uid,"2",32)) {             cs_set_user_model(id,"5")             console_print(id,"Revealed player.")             } else if (cs_get_user_model(uid,"3",32)) {             cs_set_user_model(id,"5")             console_print(id,"Revealed player.")             } else if (cs_get_user_model(uid,"4",32)) {             cs_set_user_model(id,"5")             console_print(id,"Revealed player.")             } else {             console_print(id,"That user was not faking teams.")           }           } else if (get_user_team(uid) == 3) {           console_print(id,"Player cannot be faking teams. He is a spectator.")         }         } else {         console_print(id,"Cannot use this command on this player. He/she is immune.")       }       } else {       console_print(id,"Could not recognize that user.")     }     } else {     console_print(id,"You do not have enough access to use this command.")   }   return PLUGIN_HANDLED }

Greenberet 08-29-2004 23:50

Quote:

cs_set_user_model(uid,"3")
are u sure, that u have the model 3.mdl in the cstrike/models/player/3/ order?

KRoT@L 08-29-2004 23:55

Code:
cs_set_user_model(uid,"6")
Wrong.
"6" is not a model..., valid models are :
CT models: sas, gign, gsg9, urban
T models: arctic, guerilla, leet, terror

Code:
cs_set_user_model(uid,"gign")
Code:
cs_set_user_model(uid,"leet")

Code:
if (cs_get_user_model(uid,"5",31)) {
Wrong.
cs_get_user_model returns nothing so you can't use it in a if statement

Code:
new player_model[32] cs_get_user_model(uid, player_model, 31) if(containi(player_model, "gign")!=-1){
Use something like that. :wink:


All times are GMT -4. The time now is 17:19.

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