How to do this Command?Please Help
#1

Can any one say how to make this as a CMD: ??

Here is the code!

Код:
SetPlayerAttachedObject( playerid, 0, 18645, 2, 0.017478, 0.051500, 0.003912, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
SetPlayerAttachedObject( playerid, 1, 18690, 2, -2.979508, 0.306475, -0.388553, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
SetPlayerAttachedObject( playerid, 2, 18716, 2, -2.979508, 0.306475, -0.388553, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
Please help mE!
Reply
#2

pawn Код:
#define SetPlayerHoldingObject(%1,%2,%3,%4,%5,%6,%7,%8,%9) SetPlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1,%2,%3,%4,%5,%6,%7,%8,%9)
#define StopPlayerHoldingObject(%1) RemovePlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
#define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
pawn Код:
CMD:hold(playerid, o[])
{
    for ( new i = 0; i < 5; i++ ) {
        if ( IsPlayerAttachedObjectSlotUsed( playerid, i ) ) {
            RemovePlayerAttachedObject( playerid, i );
        }
    }
    SetPlayerAttachedObject( playerid, 0, 18645, 2, 0.017478, 0.051500, 0.003912, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
    SetPlayerAttachedObject( playerid, 1, 18690, 2, -2.979508, 0.306475, -0.388553, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
    SetPlayerAttachedObject( playerid, 2, 18716, 2, -2.979508, 0.306475, -0.388553, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
    return 1;
}
Reply
#3

Where should i put this #define??
Reply
#4

at the top of your script with the rest but make sure it goes under include <a_samp>
Reply
#5

I did it like this... But I got these errors...

Код:
E:\satdm script\test\Gamemodes\SATDM~RP13.pwn(42434) : error 017: undefined symbol "IsPlayerAttachedObjectSlotUsed"
E:\satdm script\test\Gamemodes\SATDM~RP13.pwn(42435) : error 017: undefined symbol "RemovePlayerAttachedObject"
E:\satdm script\test\Gamemodes\SATDM~RP13.pwn(42438) : error 017: undefined symbol "SetPlayerAttachedObject"
E:\satdm script\test\Gamemodes\SATDM~RP13.pwn(42439) : error 017: undefined symbol "SetPlayerAttachedObject"
E:\satdm script\test\Gamemodes\SATDM~RP13.pwn(42440) : error 017: undefined symbol "SetPlayerAttachedObject"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
here is code which i put

Код:
//--------------------------Hold------------------------------------------------
#include <a_samp>

#define SetPlayerHoldingObject(%1,%2,%3,%4,%5,%6,%7,%8,%9) SetPlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1,%2,%3,%4,%5,%6,%7,%8,%9)
#define StopPlayerHoldingObject(%1) RemovePlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
#define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)

CMD:hold(playerid, o[])
{
    for ( new i = 0; i < 5; i++ ) {
        if ( IsPlayerAttachedObjectSlotUsed( playerid, i ) ) {
            RemovePlayerAttachedObject( playerid, i );
        }
    }
    SetPlayerAttachedObject( playerid, 0, 18645, 2, 0.017478, 0.051500, 0.003912, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
    SetPlayerAttachedObject( playerid, 1, 18690, 2, -2.979508, 0.306475, -0.388553, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
    SetPlayerAttachedObject( playerid, 2, 18716, 2, -2.979508, 0.306475, -0.388553, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
    return 1;
}
Reply
#6

Help !
Reply
#7

Quote:
Originally Posted by hitman%
Посмотреть сообщение
I did it like this... But I got these errors...

Код:
E:\satdm script\test\Gamemodes\SATDM~RP13.pwn(42434) : error 017: undefined symbol "IsPlayerAttachedObjectSlotUsed"
E:\satdm script\test\Gamemodes\SATDM~RP13.pwn(42435) : error 017: undefined symbol "RemovePlayerAttachedObject"
E:\satdm script\test\Gamemodes\SATDM~RP13.pwn(42438) : error 017: undefined symbol "SetPlayerAttachedObject"
E:\satdm script\test\Gamemodes\SATDM~RP13.pwn(42439) : error 017: undefined symbol "SetPlayerAttachedObject"
E:\satdm script\test\Gamemodes\SATDM~RP13.pwn(42440) : error 017: undefined symbol "SetPlayerAttachedObject"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
here is code which i put

Код:
//--------------------------Hold------------------------------------------------
#include <a_samp>

#define SetPlayerHoldingObject(%1,%2,%3,%4,%5,%6,%7,%8,%9) SetPlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1,%2,%3,%4,%5,%6,%7,%8,%9)
#define StopPlayerHoldingObject(%1) RemovePlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
#define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)

CMD:hold(playerid, o[])
{
    for ( new i = 0; i < 5; i++ ) {
        if ( IsPlayerAttachedObjectSlotUsed( playerid, i ) ) {
            RemovePlayerAttachedObject( playerid, i );
        }
    }
    SetPlayerAttachedObject( playerid, 0, 18645, 2, 0.017478, 0.051500, 0.003912, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
    SetPlayerAttachedObject( playerid, 1, 18690, 2, -2.979508, 0.306475, -0.388553, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
    SetPlayerAttachedObject( playerid, 2, 18716, 2, -2.979508, 0.306475, -0.388553, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
    return 1;
}
Did you wrote exactly like this?
Because if you did it, you have already the
pawn Код:
#include <a_samp>
At the top. Just put the include and the define on top and at the end the ZCMD. By the way do you use ZCMD? If yes
pawn Код:
#include <zcmd>
Reply
#8

i just added
Код:
#include <zcmd>
but still the same errors..

Can u paste that code?
Reply
#9

hitman% if you add the
pawn Код:
#include <zcmd>
You have to put the zcmd.inc in your server/pawno/includes. However, I am not sure why do you get these errors because you have already define them on the top.
Reply
#10

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
pawn Код:
#define SetPlayerHoldingObject(%1,%2,%3,%4,%5,%6,%7,%8,%9) SetPlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1,%2,%3,%4,%5,%6,%7,%8,%9)
#define StopPlayerHoldingObject(%1) RemovePlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
#define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
pawn Код:
CMD:hold(playerid, o[])
{
    for ( new i = 0; i < 5; i++ ) {
        if ( IsPlayerAttachedObjectSlotUsed( playerid, i ) ) {
            RemovePlayerAttachedObject( playerid, i );
        }
    }
    SetPlayerAttachedObject( playerid, 0, 18645, 2, 0.017478, 0.051500, 0.003912, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
    SetPlayerAttachedObject( playerid, 1, 18690, 2, -2.979508, 0.306475, -0.388553, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
    SetPlayerAttachedObject( playerid, 2, 18716, 2, -2.979508, 0.306475, -0.388553, 285.055511, 90.860740, 171.179550, 1.780549, 0.912008, 1.208514 );
    return 1;
}
Why are you using this

PHP код:
SetPlayerAttachedObject(playeridindexmodelidboneFloat:fOffsetXFloat:fOffsetYFloat:fOffsetZFloat:fRotXFloat:fRotYFloat:fRotZFloat:fScaleXFloat:fScaleYFloat:fScaleZ); 
instead of this

PHP код:
SetPlayerAttachedObject(playeridindexmodelbone); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)