SA-MP Forums Archive
Snow problem! - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Snow problem! (/showthread.php?tid=552296)



Snow problem! - cnoopers - 23.12.2014

The snow is not attaching to the player. I have tried do it with SetPlayerAttachedObject but I had that same problem. What is wrong?
Код:
new snow[MAX_PLAYERS];

CMD:snow(playerid, params[])
{
	if(!snowtf[playerid])
	{
		new Float:x, Float:y, Float:z, Float:angle;
		GetPlayerPos(playerid, x, y, z);
		GetPlayerFacingAngle(playerid, angle);
		snow[playerid] = CreatePlayerObject(playerid, 18864, x, y, z-25, 1.0, 4.0, angle+42.0);
		AttachObjectToPlayer(snow[playerid], playerid, x, y, z-25, 1.0, 4.0, angle+42.0);
		snowtf[playerid] = true;
	}else
	{
		DestroyPlayerObject(playerid, snow[playerid]);
		snowtf[playerid] = false;
	}
	return 1;
}



Re: Snow problem! - Kyance - 23.12.2014

pawn Код:
CMD:snow(playerid, params[])
{
    if(!snowtf[playerid])
    {
        SetPlayerAttachedObject(playerid, 0, 18864, 2, 25, 7, -10);
        snowtf[ playerid ] = true;
       
        //SendClientMessage(playerid, -1, "* snow on");
    }
    else
    {
        RemovePlayerAttachedObject(playerid, 0);
        snowtf[ playerid ] = false;
       
        //SendClientMessage(playerid, -1, "* snow off");
    }
    return 1;
}
Worked for me - You can remove the "snow[ MAX_PLAYERS ]", and just keep the "snowtf" variable.