AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Admin & Vip Customization Plugin (https://forums.alliedmods.net/showthread.php?t=69487)

DeeKeiD 04-05-2008 11:23

Admin & Vip Customization Plugin
 
Hello, i'm noob in amxx scripting i need help with my plugin(Remake of Alka's Plugin)
Here's the code :
Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
 
#define PLUGIN "Admin & Vip Customization"
#define VERSION "0.1"
#define AUTHOR "DeeKeiD"
 
 // Half of code taken from Alkas Custom Admin\Vip Plugin
 
public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR);
}
 
public client_putinserver(id) //"client_connect" is to earlyer...
{
 if((get_user_flags(id) & ADMIN_LEVEL_B))
 {
  new name[32];
  get_user_name(id, name, sizeof name - 1);
 
  set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 3.0, 7.0);
  show_hudmessage(0, "Admin %s joined on the server!", name); // Welcome message
 }
 else if((get_user_flags(id) & ADMIN_LEVEL_C))
 {
  new name[32];
  get_user_name(id, name, sizeof name - 1);
  set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 3.0, 7.0);
  show_hudmessage(0, "V.I.P %s joined on the server!", name); // Welcome Message
  client_print(id,print_chat,"Welcome back sir!"); // Private welcome message
  cs_set_user_model(id, "vip"); // change of player model to custom(vip)
  cs_set_user_deaths(id, 1337); // set player deaths to 1337
  cs_set_user_money(id , 1337); // set player money to 1337
 }
}

Works :
Quote:

1. Welcome HUD Message
2. Player Glow
Doesent work's :
Quote:

1. Change of user model to custom(vip)...
2. Setting user deaths to 1337
3. Setting user money to 1337
Things i whant to add but don't know how :
Quote:

1. Playing custom sound when player connects
Can someone tell me what i'm doing wrong and how to make it work? Thx.

rudle 04-05-2008 15:17

Re: Admin & Vip Customization Plugin
 
This should work Edited Added sound.
I did 1 2 3 and the thing you didn't know how to do.
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike>   #define PLUGIN "Admin & Vip Customization" #define VERSION "0.1" #define AUTHOR "DeeKeiD"    // Half of code taken from Alkas Custom Admin\Vip Plugin   public plugin_init() {    register_plugin(PLUGIN, VERSION, AUTHOR); } public plugin_precache() {      precache_sound("misc/vip.wav");      precache_sound("misc/admin.wav");     } public client_putinserver(id) //"client_connect" is to earlyer... {  if((get_user_flags(id) & ADMIN_LEVEL_B))  {   new name[32];   get_user_name(id, name, sizeof name - 1);     set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 3.0, 7.0);   show_hudmessage(0, "Admin %s joined on the server!", name); // Welcome message   client_cmd(id, "spk misc/admin.wav")  }  else if((get_user_flags(id) & ADMIN_LEVEL_C))  {   new name[32];   get_user_name(id, name, sizeof name - 1);   set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 3.0, 7.0);   show_hudmessage(0, "V.I.P %s joined on the server!", name); // Welcome Message   client_print(id,print_chat,"Welcome back sir!"); // Private welcome message   cs_set_user_model(id, "vip/vip.mdl"); // change of player model to custom(vip)   cs_get_user_money(id)   cs_get_user_deaths(id)   cs_set_user_deaths(id, 1337); // set player deaths to 1337   cs_set_user_money(id , 1337); // set player money to 1337   client_cmd(id, "spk misc/vip.wav")  } }

DeeKeiD 04-06-2008 08:42

Re: Admin & Vip Customization Plugin
 
it isn't working ;[

rudle 04-06-2008 09:14

Re: Admin & Vip Customization Plugin
 
Did you change it and make sure you have the sound?

DeeKeiD 04-06-2008 09:28

Re: Admin & Vip Customization Plugin
 
yes, i changed it and i have sound in my game & server folders

rudle 04-06-2008 09:46

Re: Admin & Vip Customization Plugin
 
Change
Code:

vip/vip.mdl
to
Code:

models/vip/vip.mdl
Sorry forgot about that :P

DeeKeiD 04-06-2008 09:53

Re: Admin & Vip Customization Plugin
 
changed, still not working :(

rudle 04-06-2008 12:41

Re: Admin & Vip Customization Plugin
 
Does the user have flag C
and change this
&
to
&&
Code:

else if((get_user_flags(id) && ADMIN_LEVEL_C))
Code:

{
 if((get_user_flags(id) && ADMIN_LEVEL_B))


SchlumPF* 04-06-2008 12:45

Re: Admin & Vip Customization Plugin
 
cs_set_user_model(id, "vip");

just the model name without .mdl

rudle 04-06-2008 14:47

Re: Admin & Vip Customization Plugin
 
Quote:

Originally Posted by SchlumPF* (Post 607434)
cs_set_user_model(id, "vip");

just the model name without .mdl

He did that last time look at his code before post ill test on my server okt
then send you the working code.


All times are GMT -4. The time now is 01:22.

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