SA-MP Forums Archive
[Include] walkstyle.inc - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] walkstyle.inc (/showthread.php?tid=390105)



walkstyle.inc - Emmet_ - 04.11.2012

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


Re: walkstyle.inc - Dark Sniper - 05.11.2012

nice walking include!


Re: walkstyle.inc - NoahF - 05.11.2012

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


Re: walkstyle.inc - XtremeR - 07.11.2012

Wola! Epic! +3 reps! very nice!


Re: walkstyle.inc - Y_Less - 07.11.2012

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.


Re: walkstyle.inc - Emmet_ - 07.11.2012

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


Re: walkstyle.inc - Y_Less - 07.11.2012

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?


Re: walkstyle.inc - Emmet_ - 07.11.2012

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).


Re: walkstyle.inc - Y_Less - 07.11.2012

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.


Re: walkstyle.inc - Emmet_ - 07.11.2012

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.