Help please Will +Rep
#1

How can i check Player Position On Each Object Like This

New Float:FX, Float:FY, Float:FZ;
if(IsPlayerInRangeOfPoint(playerid,5.0 ,FX,FY,FZ)) == FMOS1 && FMOS2 ;

Will That Work Cause i have about 12 Objects i want to Check Simultaneously

To see if player Is Near that Object.. There all In different Cordinates
Reply
#2

pawn Код:
new Float:ObjX[12],Float:ObjY[12],Float:ObjZ[12],obj,foundobj;
for(new i = 1; i < 13; i++)
{
    if(i == 1) { obj = FMOS1; }
    else if(i == 2) { obj = FMOS2; }
    else if(i == 3) { obj = FMOS3; }
    else if(i == 4) { obj = FMOS4; }
    else if(i == 5) { obj = FMOS5; }
    else if(i == 6) { obj = FMOS6; }
    else if(i == 7) { obj = FMOS7; }
    else if(i == 8) { obj = FMOS8; }
    else if(i == 9) { obj = FMOS9; }
    else if(i == 10) { obj = FMOS10; }
    else if(i == 11) { obj = FMOS11; }
    else if(i == 12) { obj = FMOS12; }
    GetObjectPos(obj,ObjX[i],ObjY[i],ObjZ[i]);
    if(IsPlayerInRangeOfPoint(playerid,5.0,ObjX[i],ObjY[i],ObjZ[i]))
    {
        foundobj = obj;
        //They are near the object
    }
}
/guess
Reply
#3

Okay Hey I have no Clue what ive Did Wrong Thought i was getting it right ... Could you help me again Coole210 Or Someone Else please

Nevermind I think i got it
Reply
#4

Someone Help Me Please I'm Trying to Create an Explosion Effect at Every Cordinate i have on there Under FMOS I have the smoke and The Fire just need the Explosion effect The CreateExplosion has to be repeated right? So i have To Set it Check if player Is Near any of the Explosions to Stop that Explosion on that Cordinate Location or FMOS[number] Any help be nice i'll be sure to REP anyone...

And The 3d text label wont show on neither of the Objects...

pawn Код:
forward FireSourceCheck(playerid, Health);
public FireSourceCheck(playerid, Health)
{
    new Float:ObjX[12],Float:ObjY[12],Float:ObjZ[12],obj,foundobj,FSF[256];
    for(new i = 1; i < 13; i++)
    {
        if(i == 1) { obj = FMOS1; }
        else if(i == 2) { obj = FMOS2; }
        else if(i == 3) { obj = FMOS3; }
        else if(i == 4) { obj = FMOS4; }
        else if(i == 5) { obj = FMOS5; }
        else if(i == 6) { obj = FMOS6; }
        else if(i == 7) { obj = FMOS7; }
        else if(i == 8) { obj = FMOS8; }
        else if(i == 9) { obj = FMOS9; }
        else if(i == 10) { obj = FMOS10; }
        else if(i == 11) { obj = FMOS11; }
        else if(i == 12) { obj = FMOS12; }
        GetObjectPos(obj,ObjX[i],ObjY[i],ObjZ[i]);
        TotalFires++;
        new ID = TotalFires;
        FireHealth[ID] = Health;
        FireHealthMax[ID] = Health;
        new string[128];
        format(FSF,sizeof(FSF), "Fire Source Intergity~n~~B~Health: ~W~%.1f" ,Health);
        FMOSL = Create3DTextLabel(FSF, 0xA10000AA, ObjX[i],ObjY[i],ObjZ[i], 20, 0);
        format(string, sizeof(string), "%d/%d", FireHealth[ID], FireHealthMax[ID]);
        Healthl = Create3DTextLabel(string, 0xFFFFFFFFF, ObjX[i],ObjY[i],ObjZ[i], 20, 0);
        if(IsPlayerInRangeOfPoint(playerid,5.0,ObjX[i],ObjY[i],ObjZ[i]))
        {
             foundobj = obj;
             format(FSF,sizeof(FSF),"You Have Found Object: %s",foundobj);
             SendClientMessage(playerid, BLUE, FSF);
             //They are near the object
        }
    }
    return 1;
}

public FireMission1(playerid)
{                                        //18.7187
    FMOS1 = CreateObject(3461,655.7012,-1650.6542,16.3187,0,0,0.1) && CreateObject(18727,655.7012,-1650.6542,16.3187,0,0,0.1);
    FMOS2 = CreateObject(3461,658.8012,-1645.7078,13.9950,0,0,0.1) && CreateObject(18727,658.8012,-1645.7078,13.9950,0,0,0.1);
    FMOS3 = CreateObject(3461,665.5343,-1645.0964,16.8585,0,0,0.1) && CreateObject(18727,665.5343,-1645.0964,16.8585,0,0,0.1);
    FMOS4 = CreateObject(3461,666.0158,-1651.4626,16.6945,0,0,0.1) && CreateObject(18727,666.0158,-1651.4626,16.6945,0,0,0.1);
    FMOS5 = CreateObject(3461,665.8892,-1658.3931,16.7376,0,0,0.1) && CreateObject(18727,665.8892,-1658.3931,16.7376,0,0,0.1);
    FMOS6 = CreateObject(3461,664.3278,-1638.4620,16.9617,0,0,0.1) && CreateObject(18727,664.3278,-1638.4620,16.9617,0,0,0.1);
    FMOS7 = CreateObject(3461,656.1232,-1638.5067,16.8413,0,0,0.1) && CreateObject(18727,656.1232,-1638.5067,16.8413,0,0,0.1);
    FMOS8 = CreateObject(3461,659.9551,-1631.9431,17.3707,0,0,0.1) && CreateObject(18727,659.9551,-1631.9431,17.3707,0,0,0.1);
    FMOS9 = CreateObject(3461,651.5157,-1633.2946,12.6216,0,0,0.1) && CreateObject(18727,651.5157,-1633.2946,12.6216,0,0,0.1);
    FMOS10 = CreateObject(3461,651.4227,-1640.8571,12.5628,0,0,0.1) && CreateObject(18727,651.4227,-1640.8571,12.5628,0,0,0.1);
    FMOS11 = CreateObject(3461,651.4492,-1648.1234,12.4258,0,0,0.1) && CreateObject(18727,651.4492,-1648.1234,12.4258,0,0,0.1);
    FMOS12 = CreateObject(3461,652.3084,-1659.2201,12.2652,0,0,0.1) && CreateObject(18727,652.3084,-1659.2201,12.2652,0,0,0.1);
    SetTimer("FMOSE", 2000,true);
    return 1;
}
Reply
#5

Anyone??
Reply
#6

Hope this helps a little.
Reply
#7

Not really I need it to explode at Every Cordinate I have under FMOS There 1 through 12 I can do it a different way but reason im asking cause i might want to add some others in a different location i just want a simple Code to Create a few Other Objects in there location Like As I want a 3dlabel With them aswell
Reply
#8

Where the Heck is Everyone...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)