PDA

View Full Version : Objects


trapstar2020
02/10/2012, 12:59 AM
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

Gamer`
02/10/2012, 04:17 AM
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;
}

trapstar2020
02/10/2012, 04:36 AM
i get error did u test first anyone else?

Lordzy
02/10/2012, 04:39 AM
Try this

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;
}

trapstar2020
02/10/2012, 04:50 AM
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

Lordzy
02/10/2012, 04:52 AM
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

Angle = GetPlayerFacingAngle(playerid);

trapstar2020
02/10/2012, 05:05 AM
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

http://imageshack.us/a/img854/8374/samp029wew.png (http://imageshack.us/photo/my-images/854/samp029wew.png/)