[Include] walkstyle.inc
#1

Removed. Please don't ask me for the script because I don't have it
Reply
#2

nice walking include!
Reply
#3

Great work Emmet_. I can really use these Functions, so thanks a ton.
Reply
#4

Wola! Epic! +3 reps! very nice!
Reply
#5

What's with all the PVars? You only have two variables and you know what those two variables are and how big they need to be in advance.
Reply
#6

Quote:
Originally Posted by Y_Less
View Post
What's with all the PVars? You only have two variables and you know what those two variables are and how big they need to be in advance.
I used PVars so you can use GetPlayerWalkingStyle in other scripts
Reply
#7

Fair enough, you might want to mention that in the first post. Also, how well does including this in multiple scripts work? Don't they both try and set the walk style, or is that not a problem as they're both trying to set the same thing?
Reply
#8

Okay, edited the first post.

And the other thing you've mentioned: that's not a problem at all, as they're both trying to set the same thing (PVar).

Imagine this filterscript:

pawn Code:
#define FILTERSCRIPT

#include <a_samp>
#include <walkstyle>

public OnPlayerConnect(playerid)
{
    SetPlayerWalkingStyle(playerid, 1);
    return 1;
}
And this gamemode:

pawn Code:
// Gamemode
#include <a_samp>
#include <zcmd>
#include <YSI\y_ini>
#include <streamer>
#include <timerfix>
#include <walkstyle>

public OnPlayerConnect(playerid)
{
    if (GetPlayerWalkingStyle(playerid) == 1)
    {
        SendClientMessage(playerid, -1, "Your walking style is 1.");

        new
            str[12],
            File:handle = fopen("walkingstyle.txt", io_write);

        format(str, sizeof(str), "%d", GetPlayerWalkingStyle(playerid));
        fwrite(handle, str);
        fclose(handle);
    }
    return 1;
}
It might become useful for saving a player's walking style set in a filterscript, into a file created by the gamemode (shown above).

But there are other alternatives for sharing data (CallRemoteFunction, setproperty) but in this case, I used per-player variables (although 99% of the time, you shouldn't use them because you don't need them).
Reply
#9

I was actually talking about setting their animation style in OnPlayerKeyStateChange, rather than setting the PVar, but I suspect it's still not a problem.
Reply
#10

I misunderstood your post (again lol).

And, no. it shouldn't be a problem. That, as well as the rest of the script, was tested thoroughly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)