AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED]Need fun stocks (https://forums.alliedmods.net/showthread.php?t=108053)

#8 SickneSS 11-01-2009 07:03

[SOLVED]Need fun stocks
 
The title said all:P

somebody can help me?

Thanks

alan_el_more 11-01-2009 07:15

Re: Need fun stocks
 
I don't understand very well but ...

is this?

Code:

/* Returns 1 if receiver hears sender via voice communication. */
native get_client_listen(receiver, sender);

/* Sets who can listen who. Function returns 0
* if for some reasons this setting can't be done. */
native set_client_listen(receiver, sender, listen);

/* Sets player godmode. If you want to disable godmode set only first parameter. */
native set_user_godmode(index, godmode = 0);

/* Returns 1 if godmode is set. */
native get_user_godmode(index);

/* Sets player armor. */
native set_user_armor(index, armor);

/* Sets player health. */
native set_user_health(index, health);

/* Move player to origin. */
native set_user_origin(index, const origin[3]);

/* Sets player rendering mode. */
native set_user_rendering(index, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16);

/* Gives item to player, name of item can start
 * with weapon_, ammo_ and item_. This event
 * is announced with proper message to all players. */
native give_item(index, const item[]);

/* Sets hit zones for player.
 * Parts of body are as bits:
 * 1  - generic
 * 2  - head
 * 4  - chest
 * 8  - stomach
 * 16  - left arm
 * 32  - right arm
 * 64  - left leg
 * 128 - right leg */
native set_user_hitzones(index = 0, target = 0, body = 255);

/* Get user hitzones. */
native get_user_hitzones(index, target);

/* Sets users max. speed. */
native set_user_maxspeed(index, Float:speed = -1.0);

/* Returns users max. speed. */
native Float:get_user_maxspeed(index);

/* Sets users gravity. */
native set_user_gravity(index, Float:gravity = 1.0);

/* Returns users gravity. */
native Float:get_user_gravity(index);

/* Spawns entity. */
native spawn(index);

/* Sets player noclip. If you want to disable noclip set only first parameter. */
native set_user_noclip(index, noclip = 0);

/* Returns 1 if noclip is set. */
native get_user_noclip(index);

/* Returns 1 if player has silent footsteps, 0 if footsteps are set to normal */
native get_user_footsteps(index);

/* Gives player silent footsteps.
* if set = 0 it will return footsteps to normal */
native set_user_footsteps(id, set = 1);

/* Strips all weapons from user. */
native strip_user_weapons(index);

/* Sets player frags. */
native set_user_frags(index, frags);

/scripting/include/fun.inc

#8 SickneSS 11-01-2009 07:51

Re: Need fun stocks
 
nope,like ....

Example of a part of ColorChat,but in a stock

PHP Code:

ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...)
{
    new 
message[256];

    switch(
type)
    {
        case 
NORMAL// clients scr_concolor cvar color
        
{
            
message[0] = 0x01;
        }
        case 
GREEN// Green
        
{
            
message[0] = 0x04;
        }
        default: 
// White, Red, Blue
        
{
            
message[0] = 0x03;
        }
    }

    
vformat(message[1], 251msg4);

    
// Make sure message is not longer than 192 character. Will crash the server.
    
message[192] = '^0';

    new 
teamColorChangeindexMSG_Type;
    
    if(
id)
    {
        
MSG_Type MSG_ONE;
        
index id;
    } else {
        
index FindPlayer();
        
MSG_Type MSG_ALL;
    }
    
    
team get_user_team(index);
    
ColorChange ColorSelection(indexMSG_Typetype);

    
ShowColorMessage(indexMSG_Typemessage);
        
    if(
ColorChange)
    {
        
Team_Info(indexMSG_TypeTeamName[team]);
    }


Stock....

PHP Code:

stock ColorChat(const id, const input[], any:...) {
    
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4")
    
replace_all(msg190"!y""^1")
    
replace_all(msg190"!team""^3")
    
replace_all(msg190"!team2""^0")
    
    if (
idplayers[0] = id; else get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }



Jon 11-01-2009 07:53

Re: Need fun stocks
 
Use the fun natives. Not other stocks trying to reproduce them.

Edit: read this -> http://forums.alliedmods.net/showthread.php?t=40341

#8 SickneSS 11-01-2009 08:00

Re: Need fun stocks
 
Thanks,but i dont know how to made some things,bacause im new in this :lol: ...

Doesn't exist fun stocks?

sry 4 my bad english

joropito 11-01-2009 10:16

Re: Need fun stocks
 
Quote:

Originally Posted by #8 SickneSS (Post 977833)
Thanks,but i dont know how to made some things,bacause im new in this :lol: ...

Doesn't exist fun stocks?

sry 4 my bad english

Tell us what are you trying to do and we can recommend fun stocks or other modules.

PM me if you want to talk in spanish.

#8 SickneSS 11-01-2009 10:25

Re: Need fun stocks
 
Quote:

Originally Posted by joropito (Post 977894)
Tell us what are you trying to do and we can recommend fun stocks or other modules.

PM me if you want to talk in spanish.

I need set_user_rendering,give_item and set_user_godmode stocks.

joropito 11-01-2009 10:40

Re: Need fun stocks
 
Quote:

Originally Posted by #8 SickneSS (Post 977897)
I need set_user_rendering,give_item and set_user_godmode stocks.

So you want the file fun_stocks.inc and not the one for the module with the natives.

Try this

fun_stocks.inc

#8 SickneSS 11-01-2009 11:06

Re: Need fun stocks
 
OMG I LOVE YOU:D

Jon 11-01-2009 18:13

Re: Need fun stocks
 
No you don't. Just include fun module and don't use these goddamn stocks. Why do you want to use them anyway?


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

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