problem with AttachObjectToPlayer and to Vehicle
#1

Guys i have problem with attaching objects to vehicle and players...
here is the codes:

pawn Код:
if(strcmp(cmdtext, "/lights", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new neon, vehic, Float:x, Float:y, Float:z;
           
            neon = CreateObject(18648, x,y,z, 0, 0, 0, 200.0);
            vehic = GetPlayerVehicleID(playerid);
            AttachObjectToVehicle(neon, vehic, 0.0, 0.0, 2.0, 0,0,0);
            return 1;
        }
    }
pawn Код:
if(strcmp(cmdtext, "/attach", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new veh, obj;
            obj = CreateObject(1609, 0,0,0,0,0,0, 200);
            veh = GetPlayerVehicleID(playerid);
            AttachObjectToVehicle(obj, veh, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0);
        }
        return 1;
    }
pawn Код:
if(strcmp(cmdtext, "/pattach", true) == 0)
    {
        new player, objc, Float:X, Float:Y, Float:Z;
        objc = CreateObject(1609, 0,0,0,0,0,0, 200);
        player = GetPlayerPos(playerid, X, Y, Z);
        AttachObjectToPlayer(objc, player, 1.5, 0.5, 0, 0, 1.5, 2);
        return 1;
    }
please someone post one code but to be right...

Thanks.
Reply
#2

someone help please... :S
Reply
#3

pawn Код:
if(strcmp(cmdtext, "/pattach", true) == 8)
    {
        new objc, Float:X, Float:Y, Float:Z;
        objc = CreateObject(1609, 0,0,0,0,0,0, 200);
        player = GetPlayerPos(playerid, X, Y, Z);
        AttachObjectToPlayer(objc, playerid, 1.5, 0.5, 0, 0, 1.5, 2);
        return 1;
    }

    if(strcmp(cmdtext, "/attach", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new obj;
            obj = CreateObject(1609, 0,0,0,0,0,0, 200);
            AttachObjectToVehicle(obj, GetPlayerVehicleID ( playerid ), 0.0, 0.0, 0.0, 1.0, 0.0, 0.0);
        }
        return 1;
    }

    if(strcmp(cmdtext, "/lights", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new neon, Float:x, Float:y, Float:z;

            neon = CreateObject(18648, x,y,z, 0, 0, 0, 200.0);
            AttachObjectToVehicle(neon, GetPlayerVehicleID ( playerid ), 0.0, 0.0, 2.0, 0,0,0);
            return 1;
        }
    }
Reply
#4

pawn Код:
if(strcmp(cmdtext, "/pattach", true) == 8)
{
    SetPlayerAttachedObject(playerid, 1, 1609, 1, 1.5, 0.5, 0, 0, 1.5, 2);
    return 1;
}
So it should be OK
Reply
#5

nope the objects dont work :S
Reply
#6

so noone can help me ? :S
(sorry for double post)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)