SA-MP Forums Archive
this Sending the message, when I next to each object... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: this Sending the message, when I next to each object... (/showthread.php?tid=551343)



this Sending the message, when I next to each object... - _Application_ - 18.12.2014

PHP код:
new TEST[1];  
TEST[0] = CreateObject(1,-3175.7463,1888.1807,74.7513,0,0,0);  
for(new 
iddidd sizeof(TEST); idd++)
{
    new 
Float:xFloat:yFloat:z;
    
GetObjectPos(TEST[idd], xyz);
    if(
IsPlayerInRangeOfPoint(playerid,2.2xyz))
    {
        
SendCllientMessage(playerid, -1"Test Test Test!!!!!");
    }

this Sending the message, when I next to each object
I want it to send the notice when I'm at the object that I set...
I want it to send the message only objects that I set


sorry my bad english


Re: this Sending the message, when I next to each object... - Rog - 18.12.2014

Код:
new TEST[1];   

TEST[0] = CreateObject(1,-3175.7463,1888.1807,74.7513,0,0,0);   

for(new idd; idd < sizeof(TEST); idd++) 
{ 
    new Float:x, Float:y, Float:z; 
    GetObjectPos(TEST[idd], x, y, z); 
    if(IsPlayerInRangeOfPoint(playerid,-3175.7463,1888.1807,74.7513, x, y, z)) 
    { 
        SendCllientMessage(playerid, -1, "Test Test Test!!!!!"); 
    } 
}
didnt understand wht u said but i think u want this RangeofPoint


Re: this Sending the message, when I next to each object... - _Application_ - 18.12.2014

Quote:
Originally Posted by Rog
Посмотреть сообщение
Код:
new TEST[1];   

TEST[0] = CreateObject(1,-3175.7463,1888.1807,74.7513,0,0,0);   

for(new idd; idd < sizeof(TEST); idd++) 
{ 
    new Float:x, Float:y, Float:z; 
    GetObjectPos(TEST[idd], x, y, z); 
    if(IsPlayerInRangeOfPoint(playerid,-3175.7463,1888.1807,74.7513, x, y, z)) 
    { 
        SendCllientMessage(playerid, -1, "Test Test Test!!!!!"); 
    } 
}
didnt understand wht u said but i think u want this RangeofPoint
I want it to send the message, just that I was close to objects I set up within the array...


Re: this Sending the message, when I next to each object... - M4D - 18.12.2014

you only have 1 object so you don't need a loop

use it in a timer

pawn Код:
new TEST[1];  

TEST[0] = CreateObject(1,-3175.7463,1888.1807,74.7513,0,0,0);  

new Float:x, Float:y, Float:z;
GetObjectPos(TEST[0], x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 2.2, x, y, z))
{
   SendCllientMessage(playerid, -1, "Test Test Test!!!!!");
}



Re: this Sending the message, when I next to each object... - _Application_ - 18.12.2014

Quote:
Originally Posted by M4D
Посмотреть сообщение
you only have 1 object so you don't need a loop

use it in a timer

pawn Код:
new TEST[1];  

TEST[0] = CreateObject(1,-3175.7463,1888.1807,74.7513,0,0,0);  

new Float:x, Float:y, Float:z;
GetObjectPos(TEST[0], x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 2.2, x, y, z))
{
   SendCllientMessage(playerid, -1, "Test Test Test!!!!!");
}
But I'm going to use in objects