[Include] SkinEx (CHANGES LIKE IN GTA V)
#1

SkinEx



Info



This will change you'r skin and add smoke effect like in gta v!

Function

Code:
just like a_samp

SetPlayerSkin(playerid, skinid);
Video

Click


Pics







Link

Pastebin

Update v1.1

Code:
Not much changes just reduced amx size
v1 - 6kb
v1.1 - 4kb
Pastebin

Update v1.2 (credits to pottus)

Code:
Made the effects better!
Pastebin



Credits

SA-MP Team - for samp
Lokii - for SkinEx
Incognito - for streamer
Reply
#2

1st>>>>
This is easy and simple + good job
Reply
#3

I could say it's something simple, but, something is something.
Reply
#4

Good job, small but interesting
Reply
#5

Simple but interesting
Reply
#6

I like it but don't like it, the sync between the skin change / effects makes it look like shit. The user is aware of the new skin before any effects making the feel anti-climatic. The concept is excellent but the skin change is too fast and needs to be delayed slightly to sync better with the effects. There is also a major issue with object creation/deletion!

Code:
//Made by lokii.
#include <streamer> //credits to incognito.

#define         SKIN_CHANGE_DELAY           600



/*
native SetPlayerSkin(playerid, skinid);
*/

static p_skin_obj[MAX_PLAYERS] = { -1, ... };
static p_skin_obj2[MAX_PLAYERS] = { -1, ... } ;

static DISTimer[MAX_PLAYERS];
static SkinTimer[MAX_PLAYERS];

forward DIS(playerid);
public DIS(playerid)
{
    TogglePlayerControllable(playerid, 1);
    DestroyDynamicObject(p_skin_obj[playerid]);
    return DestroyDynamicObject(p_skin_obj2[playerid]);
}

forward DelaySkinChange(playerid, skinid);
public DelaySkinChange(playerid, skinid)
{
	SetPlayerSkin(playerid, skinid);
	return 1;
}


static ResetSkinChange(playerid)
{
	// This NEEDS to be done like this otherwise you will continually destory objects
	if(p_skin_obj[playerid] > -1)
	{
	    DestroyDynamicObject(p_skin_obj[playerid]);
	    DestroyDynamicObject(p_skin_obj2[playerid]);
	    p_skin_obj[playerid] = -1;
	    p_skin_obj2[playerid] = -1;
	}

	KillTimer(DISTimer[playerid]);
	KillTimer(SkinTimer[playerid]);
}

public OnPlayerDisconnect(playerid, reason)
{
	ResetSkinChange(playerid);
	
    #if defined SE_OnPlayerDisconnect
        SE_OnPlayerDisconnect(playerid, reason);
    #endif
    return 1;
}
#if defined _ALS_OnPlayerDisconnect
    #undef OnPlayerDisconnect
#else
    #define _ALS_OnPlayerDisconnect
#endif
#define OnPlayerDisconnect SE_OnPlayerDisconnect
#if defined SE_OnPlayerDisconnect
    forward SE_OnPlayerDisconnect(playerid, reason);
#endif

stock SetPlayerSkinEx(playerid, skinid)
{
	// Destory any created objects first
	ResetSkinChange(playerid);
    new Float:e_skin_x, Float:e_skin_y, Float:e_skin_z;
    GetPlayerPos(playerid, e_skin_x, e_skin_y, e_skin_z);
    TogglePlayerControllable(playerid, 0);
    p_skin_obj[playerid] = CreateDynamicObject(18671, e_skin_x, e_skin_y, e_skin_z-2.5, 0.0, 0.0, 0.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 100.0, STREAMER_OBJECT_DD, -1, 0);
    p_skin_obj2[playerid] = CreateDynamicObject(18728, e_skin_x, e_skin_y, e_skin_z-1.5, 0.0, 0.0, 0.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 100.0, STREAMER_OBJECT_DD, -1, 0);
    DISTimer[playerid] = SetTimerEx("DIS", 1000, false, "i", playerid);
    SkinTimer[playerid] = SetTimetEx("DelaySkinChange", false, "iii", SKIN_CHANGE_DELAY, playerid, skinid);
    Streamer_Update(playerid);
    return 1;
}

#if defined _ALS_SetPlayerSkin
    #undef SetPlayerSkin
#else
    #define _ALS_SetPlayerSkin
#endif
#define SetPlayerSkin SetPlayerSkinEx


//EOF.
Reply
#7

Thanks all

EDIT:

Quote:
Originally Posted by Pottus
View Post
I like it but don't like it, the sync between the skin change / effects makes it look like shit. The user is aware of the new skin before any effects making the feel anti-climatic. The concept is excellent but the skin change is too fast and needs to be delayed slightly to sync better with the effects. There is also a major issue with object creation/deletion!

Code:
//Made by lokii.
#include <streamer> //credits to incognito.

#define         SKIN_CHANGE_DELAY           600



/*
native SetPlayerSkin(playerid, skinid);
*/

static p_skin_obj[MAX_PLAYERS] = { -1, ... };
static p_skin_obj2[MAX_PLAYERS] = { -1, ... } ;

static DISTimer[MAX_PLAYERS];
static SkinTimer[MAX_PLAYERS];

forward DIS(playerid);
public DIS(playerid)
{
    TogglePlayerControllable(playerid, 1);
    DestroyDynamicObject(p_skin_obj[playerid]);
    return DestroyDynamicObject(p_skin_obj2[playerid]);
}

forward DelaySkinChange(playerid, skinid);
public DelaySkinChange(playerid, skinid)
{
	SetPlayerSkin(playerid, skinid);
	return 1;
}


static ResetSkinChange(playerid)
{
	// This NEEDS to be done like this otherwise you will continually destory objects
	if(p_skin_obj[playerid] > -1)
	{
	    DestroyDynamicObject(p_skin_obj[playerid]);
	    DestroyDynamicObject(p_skin_obj2[playerid]);
	    p_skin_obj[playerid] = -1;
	    p_skin_obj2[playerid] = -1;
	}

	KillTimer(DISTimer[playerid]);
	KillTimer(SkinTimer[playerid]);
}

public OnPlayerDisconnect(playerid, reason)
{
	ResetSkinChange(playerid);
	
    #if defined SE_OnPlayerDisconnect
        SE_OnPlayerDisconnect(playerid, reason);
    #endif
    return 1;
}
#if defined _ALS_OnPlayerDisconnect
    #undef OnPlayerDisconnect
#else
    #define _ALS_OnPlayerDisconnect
#endif
#define OnPlayerDisconnect SE_OnPlayerDisconnect
#if defined SE_OnPlayerDisconnect
    forward SE_OnPlayerDisconnect(playerid, reason);
#endif

stock SetPlayerSkinEx(playerid, skinid)
{
	// Destory any created objects first
	ResetSkinChange(playerid);
    new Float:e_skin_x, Float:e_skin_y, Float:e_skin_z;
    GetPlayerPos(playerid, e_skin_x, e_skin_y, e_skin_z);
    TogglePlayerControllable(playerid, 0);
    p_skin_obj[playerid] = CreateDynamicObject(18671, e_skin_x, e_skin_y, e_skin_z-2.5, 0.0, 0.0, 0.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 100.0, STREAMER_OBJECT_DD, -1, 0);
    p_skin_obj2[playerid] = CreateDynamicObject(18728, e_skin_x, e_skin_y, e_skin_z-1.5, 0.0, 0.0, 0.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 100.0, STREAMER_OBJECT_DD, -1, 0);
    DISTimer[playerid] = SetTimerEx("DIS", 1000, false, "i", playerid);
    SkinTimer[playerid] = SetTimetEx("DelaySkinChange", false, "iii", SKIN_CHANGE_DELAY, playerid, skinid);
    Streamer_Update(playerid);
    return 1;
}

#if defined _ALS_SetPlayerSkin
    #undef SetPlayerSkin
#else
    #define _ALS_SetPlayerSkin
#endif
#define SetPlayerSkin SetPlayerSkinEx


//EOF.
yea thanks for that i changed the delay to 1000 tho you could still see the skin changing at 600


Update v1.2 (credits to pottus)

Code:
Made the effects better!
Pastebin
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)