Raised This Month: $ Target: $400
 0% 

Ice Skating!


Post New Thread Reply   
 
Thread Tools Display Modes
Elite_Fallen_Angel
Member
Join Date: Dec 2006
Location: HELL.....AkA, Texas
Old 10-04-2007 , 16:21   Re: Ice Skating!
Reply With Quote #31

I was working until 5 in the morning on this and was stumped trying to figure it out. I wasn't sure if I could use a Matrix until I stumbled across it in the wiki. Regardless, I didn't know if it would be applicable.

Also, throughout the night I got it to where the sound would play in a loop manner but when completely stopped they still looped.

I applied the code you supplied and it still just loops. Even if I stand completely still and not move anything it loops. Also, When I disable iceskate mode it still loops until map change.

I understand the logic in your code though. It was along the lines of what I was thinking of without the matrix. I just used a numerous amount of loops to compensate for the lack of a matrix.

Also, When you get the users origin, I wasn't sure if it actually assigned an index in the array that value rather then just retrieving the origin for the time being. I suppose it does assign the value to the index though.

One last thing, I was looking through scripting help because I was at a point in the code where when I compiled it and ran it I heard the noises of other players rather then myself. Would using
Code:
client_cmd(players[i],"spk misc/iceskate")
by sufficient?

I do appreciate your guys help. I am learning very much from this. It's pretty fun while at the same time challenging. You guys are going in the credits BIG TIME!
__________________
amXXX The new generation......


Elite_Fallen_Angel is offline
Send a message via AIM to Elite_Fallen_Angel Send a message via Yahoo to Elite_Fallen_Angel
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 10-04-2007 , 16:48   Re: Ice Skating!
Reply With Quote #32

Quote:
Originally Posted by purple_pixie View Post
33 is perfectly valid.

Whilst there may well be no player 0, I really can't be arsed to -1 from id every time.
It's just something I've gotten used to and I don't intend to change.

If you can notice 6 extra cells being used ...

But quite right - the z-axis is irrelevant.

Although if you really want to, naturally you can replace every instance of [id] with [id-1] and 33 with 32.
Umm what? You start all your loops at cell 0 (and save to cell 0) and loop up until 31. Theres no reason to have the matrix be 33 cells "long".

Yeah you heard other peoples footsteps because it emitted the sound from everyone (using spk should work though you need the .wav extension and it will not be able to hear other's skates even if you are near).

EDIT: Errrm I misread some of your code yesterday and don't exactly see how that would work. If it doesn't try this:
Code:
new frame // "x" in yours
new player_origin1[32][3];  //These 2 origin arrays will be parallel
new player_origin2[32][3];
public GetOrigin()
{
    new players[32], PlayerCount; //players is parallel with the origin arrays
    get_players(players, PlayerCount, "ah")
    
    static i
    
    if(frame==0)
    {    
        for (i=0; i<PlayerCount; i++)
        {
            get_user_origin(players[i], player_origin1[i])
        }
    }
    else
    {
        for (i=0; i<PlayerCount; i++)
        {
            get_user_origin(players[i], player_origin2[i])
        
            if (player_origin1[i][0] == player_origin2[i][0] || player_origin1[i][1] == player_origin2[i][1] ))
            {
                emit_sound(players[i],CHAN_VOICE, "misc/iceskate.wav", 0.8, ATTN_NORM, 0, PITCH_NORM)
            }
        }
    }
    frame = !frame 
}
Its the same function that pixie posted with "i" used in place of id and with 32 cell-long arrays.
Note that the functions header was changed and no longer uses "id". Also if a player disconnects within the interval that this method is called.
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.

Last edited by Lord_Destros; 10-04-2007 at 17:00.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-04-2007 , 17:55   Re: Ice Skating!
Reply With Quote #33

The method used can be done using the server console. The plugin is 815 bytes. If you can offer something useful in the future, PM me or another plugin approver and we will reconsider.

For now, unapproved.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 10-05-2007 , 05:06   Re: Ice Skating!
Reply With Quote #34

Destros, sadly that just doesn't work.
You can't use "i" as the index in the player_origin array.
It has to be the player index ...

If a player joins in between the two "frames", then it would screw everything up.

EDIT: If you need it using only 32 cells per array, you want it like this:
PHP Code:
new frame // "x" in yours
new player_origin1[32][3];  //These 2 origin arrays will be parallel
new player_origin2[32][3];
public 
GetOrigin()
{
    new 
players[32], PlayerCount;
    
get_players(playersPlayerCount"ah")
    
    static 
i,id
    
    
if(frame==0)
    {    
        for (
i=0i<PlayerCounti++)
        {
            
get_user_origin(players[i], player_origin1[players[i]-1])
        }
    }
    else
    {
        for (
i=0i<PlayerCounti++)
        {
        
id players[i]-1
            get_user_origin
(idplayer_origin2[id])
        
            if (
player_origin1[id][0] == player_origin2[id][0] || player_origin1[id][1] == player_origin2[id][1] ))
            {
                
emit_sound(id,CHAN_VOICE"misc/iceskate.wav"0.8ATTN_NORM0PITCH_NORM)
            }
        }
    }
    
frame = !frame 


Last edited by purple_pixie; 10-05-2007 at 05:11.
purple_pixie is offline
totopito
BANNED
Join Date: Apr 2007
Location: In Your Room
Old 10-13-2007 , 09:36   Re: Ice Skating!
Reply With Quote #35

You should create an ice skate map for ice skating
totopito is offline
Send a message via MSN to totopito
Elite_Fallen_Angel
Member
Join Date: Dec 2006
Location: HELL.....AkA, Texas
Old 10-13-2007 , 09:52   Re: Ice Skating!
Reply With Quote #36

Already did.
__________________
amXXX The new generation......


Elite_Fallen_Angel is offline
Send a message via AIM to Elite_Fallen_Angel Send a message via Yahoo to Elite_Fallen_Angel
Cityny
Junior Member
Join Date: Apr 2008
Old 08-10-2008 , 16:18   Re: Ice Skating!
Reply With Quote #37

Think you could make it not work for every one?

Like

amx_iceskate <name>


So that only that person can do it?
Cityny is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:32.


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