SA-MP Forums Archive
Objects - 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: Objects (/showthread.php?tid=382089)



Objects - trapstar2020 - 02.10.2012

pawn Код:
CMD:spray(playerid, params[])
{
        new Float:X, Float:Y, Float:Z, Float:Angle;
        new myobject;
        GetPlayerPos(playerid, X, Y, Z);
        GetPlayerFacingAngle(playerid, Angle);
        myobject = CreateObject(1490, X, Y, Z+0.5, 0.0,0.0 , Angle, 100);
        return 1;
}
i cant get the object to create infront the player


Re: Objects - Gamer` - 02.10.2012

pawn Код:
CMD:spray(playerid, params[])
{
        new Float:X[MAX_PLAYERS], Float:Y[MAX_PLAYERS], Float:Z[MAX_PLAYERS], Float:Angle[MAX_PLAYERS];
        GetPlayerPos(playerid, X[playerid], Y[playerid], Z[playerid]);
        GetPlayerFacingAngle(playerid, Angle[playerid]);
        CreateObject(1490, X, Y, Z+0.5, 0.0,0.0 , Angle, 100);
        return 1;
}



Re: Objects - trapstar2020 - 02.10.2012

i get error did u test first anyone else?


Re: Objects - Lordzy - 02.10.2012

Try this
pawn Код:
CMD:spray(playerid, params[])
{
        new Float:X, Float:Y, Float:Z;
        new Angle;
        new myobject;
        GetPlayerPos(playerid, X, Y, Z);
        GetPlayerFacingAngle(playerid, Angle);
        myobject = CreateObject(1490, X, Y, Z+0.5, 0.0,0.0 , Angle, 100);
        return 1;
}



Re: Objects - trapstar2020 - 02.10.2012

pawn Код:
CMD:spray(playerid, params[])
{
        new Float:X, Float:Y, Float:Z, Float:Angle;
        GetPlayerPos(playerid, X, Y, Z);
        GetPlayerFacingAngle(playerid, Angle);
        CreateObject(1490, X, Y, Z+0.5, 0.0,0.0 , Angle-270, 100);
        return 1;
}
SOLVED LORDZ TAG MIS MATCH WITH ANGLE


Re: Objects - Lordzy - 02.10.2012

Quote:
Originally Posted by trapstar2020
Посмотреть сообщение
pawn Код:
CMD:spray(playerid, params[])
{
        new Float:X, Float:Y, Float:Z, Float:Angle;
        GetPlayerPos(playerid, X, Y, Z);
        GetPlayerFacingAngle(playerid, Angle);
        CreateObject(1490, X, Y, Z+0.5, 0.0,0.0 , Angle-270, 100);
        return 1;
}
SOLVED LORDZ TAG MIS MATCH WITH ANGLE
Try replacing that line with this and check
pawn Код:
Angle = GetPlayerFacingAngle(playerid);



Re: Objects - trapstar2020 - 02.10.2012

nope the code iz 99% perfect i just have to edit the X or Y coord to put it a little front of the player :d i cant remember which after test twice i would know