How to convert house pickups to checkpoints (Only be seen if player is near checkpoint) -
anantanni - 23.05.2011
Look, so I want to convert pickups to checkpoints only for houses. I know I can do that easily. But the problem is how to make them appear only when player is NEAR THE checkpoint..
Well here's my code under OnGameModeInit right now
pawn Код:
//^^OnGameModeInit shitt :P
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(HouseInfo[h][hOwned] == 0)
{
Create3DTextLabel("[Property]",0x00AE00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,20.0,0,1);
HouseInfo[h][hPickupID]=CreatePickup(1273, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
pickups++;
}
if(HouseInfo[h][hOwned] == 1)
{
Create3DTextLabel("[Property]",0x00AE00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,20.0,0,1);
HouseInfo[h][hPickupID]=CreatePickup(1239, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
pickups++;
}
}
Um well also.. Should I put the checkpoint in OnPlayerUpdate or what..
Re: How to convert house pickups to checkpoints (Only be seen if player is near checkpoint) -
FinestCalis - 25.05.2011
Same problem. Red checkpoints on house stand porch.
Re: How to convert house pickups to checkpoints (Only be seen if player is near checkpoint) -
WooTFTW - 25.05.2011
If you're not using incognoto's streamer, you might want to start using it.
It's pretty simple, just replace
CreatePickup with
CreateDynamicCP:
pawn Код:
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(HouseInfo[h][hOwned] == 0)
{
Create3DTextLabel("[Property]",0x00AE00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,20.0,0,1);
}
if(HouseInfo[h][hOwned] == 1)
{
Create3DTextLabel("[Property]",0x00AE00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,20.0,0,1);
}
HouseInfo[h][hPickupID]=CreateDynamicCP(HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 2, -1, -1,-1, 10);
pickups++;
}
You might want to edit checkpoint's stream distance( last parameter )
Incognoto's streamer(Clicky)
Re: How to convert house pickups to checkpoints (Only be seen if player is near checkpoint) -
FinestCalis - 25.05.2011
Orale, thank you! But what about that, if i stay at the front porch of the house and checkpoint doesen't dissapear? How i can make that?
Re: How to convert house pickups to checkpoints (Only be seen if player is near checkpoint) -
WooTFTW - 25.05.2011
Quote:
Originally Posted by FinestCalis
Orale, thank you! But what about that, if i stay at the front porch of the house and checkpoint doesen't dissapear? How i can make that?
|
What do you mean? Increase/decrease checkpoint's streaming distance?
Re: How to convert house pickups to checkpoints (Only be seen if player is near checkpoint) -
FinestCalis - 25.05.2011
Nah, right now It's like umm.. if you step on the checkpoint it will dissapear, but how i can make that if you step in that checkpoint, then you can see it. ( if you stand on the checkpoint, then you can see it too. )
Re: How to convert house pickups to checkpoints (Only be seen if player is near checkpoint) -
WooTFTW - 25.05.2011
Show me your
OnPlayerEnterCheckpoint callback.
Re: How to convert house pickups to checkpoints (Only be seen if player is near checkpoint) -
anantanni - 25.05.2011
Here comes me!
Well I made it to appear on house doors

But I got the same problem as @FinestCalis..
My code -
http://pastebin.com/1NpBMSZL
Re: How to convert house pickups to checkpoints (Only be seen if player is near checkpoint) -
WooTFTW - 25.05.2011
Remove your
OnPlayerEnterDynamicCheckpoint callback and remove
OnPlayerEnterCheckpoint Callback. Then try
Re: How to convert house pickups to checkpoints (Only be seen if player is near checkpoint) -
anantanni - 25.05.2011
I cannot remove the OnPlayerEnterCheckpoint(default sa-mp one) Because it will get my whole script bugged off.