Problem with object CAT_SAFE_ROB id 1829 - 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: Problem with object CAT_SAFE_ROB id 1829 (
/showthread.php?tid=457195)
Problem with object CAT_SAFE_ROB id 1829 -
UserName31 - 09.08.2013
hello i have been trying to make this 1829 object work like when players do /robstore
the object will show and the player will do the animation i already have animation but the object i need it like to apear in front of players while the player is doing the animation again is is 1829
Re: Problem with object CAT_SAFE_ROB id 1829 -
BullseyeHawk - 09.08.2013
pawn Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
if (GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
GetXYInFrontOfPlayer(playerid, x, y, 2.0);
// CreateObject(1829, x, y, z, ...); // <== Do this yourself.
Hope I helped! Enjoy.
Re: Problem with object CAT_SAFE_ROB id 1829 -
UserName31 - 11.08.2013
Quote:
Originally Posted by BullseyeHawk
pawn Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance) { new Float:a; GetPlayerPos(playerid, x, y, a); GetPlayerFacingAngle(playerid, a); if (GetPlayerVehicleID(playerid)) { GetVehicleZAngle(GetPlayerVehicleID(playerid), a); } x += (distance * floatsin(-a, degrees)); y += (distance * floatcos(-a, degrees)); }
pawn Код:
new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); GetXYInFrontOfPlayer(playerid, x, y, 2.0); // CreateObject(1829, x, y, z, ...); // <== Do this yourself.
Hope I helped! Enjoy.
|
please be more spacific like were do i add it here is my command
PHP код:
if(!strcmp(cmdtext, "/test", true))
{
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob",4.1,1,1,1,1,1);
return 1;
}
were do i put it at?