AlliedModders

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

deadbunny 05-08-2013 06:17

VIP
 
Hello !
I made a vip for jailbreak. But, the VIP hasn't a prisonier (model of prisonier or model of ct) , he had the default model. And, when he buy a knife (it's in menu) the knife model doesn't change.
Code:

#pragma semicolon 1

#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>

#define PLUGIN "[JB] VIP"
#define VERSION "1.0"
#define AUTHOR "eRdeneR"

#define ADMIN_JBVIP ADMIN_LEVEL_H

new const PREFIX[] = { "!g[JbX.FreakZ.Ro - VIP]!n" };

new VipUsed[33];
new HasSpeed; 
/*============================================================
                        Weapon Model's
============================================================*/
new knife1[] = "models/player/VIPJbxFreakz/knife1.mdl";
new knife2[] = "models/player/VIPJbxFreakz/knife2.mdl";
new knife3[] = "models/player/VIPJbxFreakz/knife3.mdl";
new knife4[] = "models/player/VIPJbxFreakz/knife4.mdl";

public plugin_precache()
{
        precache_generic(knife1);
        precache_generic(knife2);
        precache_generic(knife3);
        precache_generic(knife4);
}

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

    // Add your code here...

    RegisterHam(Ham_Spawn, "player", "FwdHamSpawn_Post");
    RegisterHam(Ham_Item_PreFrame, "player", "FwdPreFrame_Post");
   
    register_clcmd("say /cutitevip", "cmdVmenu");
    register_clcmd("say_team /cutitevip", "cmdVmenu");
}

public FwdPreFrame_Post(id)
{
    if(!is_user_alive(id))
    {
        return PLUGIN_HANDLED;
    }

    if(!HasSpeed)
    {
        return PLUGIN_HANDLED;
    }
   
    else if(HasSpeed)
    {
        set_user_maxspeed(id, 500.0);
    }
   
    return PLUGIN_HANDLED;
}

public FwdHamSpawn_Post(id)
{
    HasSpeed = false;
    VipUsed[id] = false;
    set_user_maxspeed(id, 250.0);
    set_user_rendering( id, _, 0, 0, 0, _, 0 ); 
    set_user_footsteps(id, 0);
}


public cmdVmenu(id)
{
    if(is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H && !( VipUsed[id] ) )
    {
        VipMenu(id);
    }
   
    else if(VipUsed[id])
    {
        client_printc(id, "%s Deja ai folosit !gVIP!n runda aceasta. Asteapta pana runda urmatoare", PREFIX);
    }
   
    else
    {
        client_printc(id, "%s Doar !gVIPs!n !gTeroristii!n sau !gContra-Teroristii!n pot folosi VIP", PREFIX);
        return PLUGIN_HANDLED;
    }
   
    return PLUGIN_HANDLED;
}

public VipMenu(id)
{
    new menu = menu_create("yJailBreak VIP Menu:^nrby zBANG !!", "VipMenu_handler");

    menu_additem(menu, "wCutit de Macelar", "1", 0);
    menu_additem(menu, "wSabiutza", "2", 0);
    menu_additem(menu, "wDrujba", "3", 0);
    menu_additem(menu, "wBata", "4", 0);
    menu_additem(menu, "wExit", "5", 0);
   
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
    menu_display(id, menu, 0);
}

public VipMenu_handler(id, menu, item)
{
    if( item == MENU_EXIT )
    {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }

    new data[6], iName[64];
    new access, callback;
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

    new key = str_to_num(data);

    switch(key)
    {
        case 1:
        { 
            VipUsed[id] = true;
            cs_set_user_model(id, "knife1");
            client_printc(id, "%s Ai cumparat !gCutit de Macelar!n", PREFIX);
            set_user_armor(id, 150);
            set_user_health(id, 250);       
        }
        case 2:
        {
            cs_set_user_model(id, "knife2");
            VipUsed[id] = true;
            client_printc(id, "%s Ai cumparat !gSabiutza!n", PREFIX);
            set_user_armor(id, 150);
  }
        case 3:
        {
            VipUsed[id] = true;
            cs_set_user_model(id, "knife3");
            client_printc(id, "%s Ai cumparat !Drujba!n", PREFIX);
            set_user_health(id, 250);
        }
        case 4:
        { 
            VipUsed[id] = true;               
            cs_set_user_model(id, "knife4");             
            client_printc(id, "%s Ai cumparat !gBata!n", PREFIX); 
            set_user_maxspeed(id, 380.0) ;   
}
    }

    menu_destroy(menu);
    return PLUGIN_HANDLED;
}


stock client_printc(const id, const input[], any:...)
{
    new count = 1, players[32];
    static msg[191];
    vformat(msg, 190, input, 3);
   
    replace_all(msg, 190, "!n", "^x01"); // Default Renk(Sari)
    replace_all(msg, 190, "!g", "^x04"); // Yesil Renk
    replace_all(msg, 190, "!t", "^x03"); // Takim Renk( CT mavi , T kirmizi )
   
    if (id) players[0] = id; else get_players(players, count, "ch");
    {
        for (new i = 0; i < count; i++)
        {
            if (is_user_connected(players[i]))
            {
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
                write_byte(players[i]);
                write_string(msg);
                message_end();
            }
        }
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{ rtf1 ansi deff0{ fonttbl{ f0 fnil Tahoma;}}n viewkind4 uc1 pard lang1055 f0 fs16 n par }
*/

So. I want this:
1. VIP had a model , models/player/VIPJbxFreakz/vip.mdl
2. The knifes (cutit de macelar, sabiutza, bata, drujba) have the models: Cutit de macelar - knife1
sabiutza - knife2 , bata - knife3 , drujba - knife4 .
3. When the VIP attack another player with knife1 he make damage 80 , with knife 2 damage 45 , with knife3 damage 99 , with knife4 damage 70 .

Well, if you know only one of this solutions , post only one solution , no with "not sure"
HELP PLEASEEE !

Unkolix 05-08-2013 08:11

Re: VIP
 
Shouldn't the models be in the same folder name as the model it self?
PHP Code:

"models/player/VIPJbxFreakz/knife1.mdl" 

:arrow:
PHP Code:

"models/player/VIPJbxFreakz/knife1/knife1.mdl" 


deadbunny 05-08-2013 12:31

Re: VIP
 
Doesn't work.

.Dare Devil. 05-08-2013 16:03

Re: VIP
 
cs_set_user_model(id, knife1) without ""

YamiKaitou 05-08-2013 16:40

Re: VIP
 
Quote:

Originally Posted by Unkolix (Post 1948053)
Shouldn't the models be in the same folder name as the model it self?
PHP Code:

"models/player/VIPJbxFreakz/knife1.mdl" 

:arrow:
PHP Code:

"models/player/VIPJbxFreakz/knife1/knife1.mdl" 


No, remove the VIPJbxFReakz from the path. It should be
models/player/knife1/knife1.mdl

Quote:

Originally Posted by .Dare Devil. (Post 1948319)
cs_set_user_model(id, knife1) without ""

No, must be in quotes

.Dare Devil. 05-08-2013 19:01

Re: VIP
 
Quote:

Originally Posted by YamiKaitou (Post 1948350)
No, remove the VIPJbxFReakz from the path. It should be
models/player/knife1/knife1.mdl


No, must be in quotes

player model not view model, right! my bad...

deadbunny 05-09-2013 12:00

Re: VIP
 
Finally:
1. when you press "tab" and you're spec , the score tabel doesn't work (it's total empty) .
2. when you're spec , you are glued to floor .
I want this:
1. Solve those bugs.
2. When you buy a knife (Cutit de macelar, Sabiutza, etc.) you have the model of HANDS knife1 , knife2 etc.
3. When you buy a knife and attack a player , you take other damage (knife1 = 80 , knife2 =40 , knife3 = 50 , knife4=100)
4. When you're a vip, you have the model jbxfreakzvip.mdl .

HELP ME , PLEASE !


All times are GMT -4. The time now is 10:50.

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