Embarrassing (CreateObject)
#1

What need i do to get "MyObject" infron of me when i type the command to create the object?

Like if im facing South then i type the command, then the object spawn North (behind me)
and i want the object onfront of me... (My Facing Angle)

pawn Код:
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
MyObject[playerid] = CreateObject(1337, X+0.8, Y, Z-1, 0.0, 0.0, 0.0);
Reply
#2

like the party server?
Reply
#3

Quote:
Originally Posted by peterory
Посмотреть сообщение
like the party server?
No, maybe, i dont know.. i have never played on a party server, LoL
Reply
#4

lol I dont know how to fix that XD
Reply
#5

Nobudy can help? LuLz
Reply
#6

Use GetXYInFrontOfPlayer function, to get Object's X Y.
Reply
#7

Quote:
Originally Posted by cmg4life
Посмотреть сообщение
Use GetXYInFrontOfPlayer function, to get Object's X Y.
It is night here and i havent slept much, and i fail

Could you give a example?

pawn Код:
#include <a_samp>

new MyObject[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/create", cmdtext, true, 10) == 0)
    {
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
       
        MyObject[playerid] = CreateObject(1337, X+0.8, Y, Z-1, 0.0, 0.0, 0.0);
        return 1;
    }
    return 0;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    DestroyObject(MyObject[playerid]);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)