AttachObjectToPlayer
#1

How could i attach a briefcase to a player?And check if it is attached to player like

Buy a briefcase in 24/7(if you die,you loose it),you go to rob the bank,if you don't have a briefcase you just can't rob it!
Reply
#2

There is a FS that will help you attaching the object, then when you die you destroy the object, and if you wanna check if he has the briefcase, you must make a variable.

Something like this:

pawn Код:
new bool:HasObject[MAX_PLAYERS];

stock AttachObjectToPlayerEx(objectid, playerid, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:rX, Float:rY, Float:rZ)
{
    AttachObjectToPlayer(objectid, playerid, OffsetX, OffsetY, OffsetZ, rX, rY, rZ);
    HasObject[playerid] = true;
    return 1;
}

stock DetachObject(objectid)
{
    DestroyObject(objectid);
    HasObject[playerid] = false;
    return 1;
}

stock HasAttachedObject(playerid)
{
    return HasObject[playerid];
}
To use that you will have to use AttachObjectToPlayerEx.
Reply
#3

Thx man,it worked xD
Reply
#4

You might want to look at this function i think it will do a better job for what you want than "AttachObjectToPlayer".

SetPlayerHoldingObject
Reply
#5

Quote:
Originally Posted by iggy1
Посмотреть сообщение
You might want to look at this function i think it will do a better job for what you want than "AttachObjectToPlayer".

SetPlayerHoldingObject
Yes,that's what im searching,thx alot xD
Reply
#6

Your welcome.
Reply
#7

Quote:
Originally Posted by SkizzoTrick
Посмотреть сообщение
How could i attach a briefcase to a player?
Код:
SetPlayerHoldingObject( playerid, 1210, 6, 0.303294, 0.081651, 0.010630, 0.000000, 270.000000, 0.000000 ); // briefcase
To check if player is holding briefcase you need to save that information to a var. To cancel briefcase se this:

Код:
StopPlayerHoldingObject(playerid);
Reply
#8

Quote:
Originally Posted by mick88
Посмотреть сообщение
Код:
SetPlayerHoldingObject( playerid, 1210, 6, 0.303294, 0.081651, 0.010630, 0.000000, 270.000000, 0.000000 ); // briefcase
To check if player is holding briefcase you need to save that information to a var. To cancel briefcase se this:

Код:
StopPlayerHoldingObject(playerid);
How did you find the coordinates?xD
Reply
#9

There are a few filterscripts try this one by g_aSlice: Hold Studio
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)