#1

Well, I made this command /cone, but it creates the cone in air..


pawn Код:
stock CreateCone(playerid, Float:x, Float:y, Float:z, Float:Angle)
{
    for(new i = 0; i < sizeof(cInfo); i++)
    {
        if(cInfo[i][cCreated] == 0)
        {
            cInfo[i][cCreated] = 1;
            cInfo[i][cOwner] = playerid;
            cInfo[i][cObject] = CreateObject(1238, x, y, z, 0.0, 0.0, Angle);
            return 1;
        }
    }
    return 0;
}
Reply
#2

Just add
pawn Код:
GetPlayerPos(playerid, x,y,z);
GetPlayerFacingAngle(playerid,angle);
On top of "cInfo[i][created] = 1;" thing.
Reply
#3

Assuming you're using a player's position, player's Z position is not exactly the ground, it's always a unit or two higher than the ground, where the center of the body is actually at.

Lower the object you're trying to place.
Reply
#4

Added what you said above still the same problem.

I have this in the /cone command.
pawn Код:
GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, A);
    CreateCone(playerid, X, Y, Z, A);
Reply
#5

He means, decrease the Object Pos Z, because GetPlayerPos gets the position from the players body, try this code, if it's too low increase it, just do some experiment.

pawn Код:
stock CreateCone(playerid, Float:x, Float:y, Float:z, Float:Angle)
{
    for(new i = 0; i < sizeof(cInfo); i++)
    {
        if(!cInfo[i][cCreated])
        {
            cInfo[ i ][ cCreated ] = 1;
            cInfo[ i ][ cOwner ] = playerid;
            cInfo[ i ][ cObject ] = CreateObject(1238, x, y, z - 0.8, 0.0, 0.0, Angle);
            return 1;
        }
    }
    return 0;
}
Reply
#6

Oh well, I'll increase it a bit, but works and thank you guys.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)