13.02.2015, 10:48
Quote:
|
You can't. That's not a one-to-one relationship. If I create five telephone boxes then do:
pawn Code:
|
if in gamemode have worldobject(telephone) and it's on this coords.
world_object_telephone[1] = posx:123.1 posy:35.5 posz:22.1;
world_object_telephone[2] = posx:222.2 posy:10.0 posz: 15.5;
world_object_telephone[3] = posx:1422.2 posy:150.0 posz: 105.5;
can script make if player go near telephone, first check by objectid and get model from objectid
second if objectmodel(objectid) == telephone_model player can use this telephone
then if i have 3 telephone,coord of any telephone not duplicate because it's has different ObjectID.
that's my think(i'm lazy to save any phone coords in game.so sorry)
full my plan code
Code:
stock IsPlayerNearModelID(pid,modelid)
{
new Float:x,Float:y,Float:z;
for(new i=0;i<MAX_OBJECTS;i++)
{
if(GetObjectModel(i) == modelid)
{
GetObjectPos(i,x,y,z);
if(PlayerToPoint(5.0,pid,x,y,z)
{
//do something
break;
}
}
}
}
ps.sorry for my bad english and my bad script


