keep SetPlayerAttachedObject issue +rep
#1

hi,

how can i make it like a player also can keep the attached object after death?

thx
Reply
#2

Well if you have a variable set for whether or not they have the object attached, you could put it OnPlayerSpawn.

If you have the variable, then it would be like this:

PHP код:
public OnPlayerSpawn(playerid)
{
       if(
ObjectAttached[playerid] == 1)
       {
                
SetPlayerAttachedObject(playerid316092); //That is a random object. Put this for whatever you had.
       
}
       else

Reply
#3

thx, yes i know the method u mentioned but if there is a kinda shop and players can buy clothes/objects there are many different objects so how to know what object shall be reattached after death?
Reply
#4

Well I think for that, you would need to do many different variables for each object.
Reply
#5

Quote:
Originally Posted by Nuke547
Посмотреть сообщение
Well I think for that, you would need to do many different variables for each object.
no can't you do this, when you buy the object you could add different number for each of the objects, like object 1 will be
pawn Код:
Object[playerid] = 1;
and object 2
pawn Код:
Object[playerid] = 2;
You can do if playerspawns it will be like this
pawn Код:
if(Object[playerid] == 1)
{
       //code
}
if(Object[playerid] == 2)
{
       //code
}
Reply
#6

Or you can set two variables. One containing the purchased object's model ID, and another one to see if the object is attached to player or not as Nuke547 said.
Reply
#7

Quote:
Originally Posted by Chris White
Посмотреть сообщение
Or you can set two variables. One containing the purchased object's model ID, and another one to see if the object is attached to player or not as Nuke547 said.
Why 2 variables? Just detect if Object is 0 that means its not detached or if its over 0 that means it is
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)