Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: MatheuS on March 18, 2014, 07:18:44 pm

Title: [FUNCTION] ProxDetectorS
Post by: MatheuS on March 18, 2014, 07:18:44 pm
Code: [Select]
forward ProxDetectorS(Float:radi, playerid, targetid);
public ProxDetectorS(Float:radi, playerid, targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
//radi = 2.0; //Trigger Radius
GetPlayerPos(targetid, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return true;
}
}
return 0;
}

Eg.:

Using a command or a function

Code: [Select]
                        if (ProxDetectorS(8.0, playerid, plr))
       {
                            SendClientMessage(playerid, -1, "The player is near you!");
                       }
else
{
SendClientMessage(playerid, -1, "  The character is far from You!");
return true;
                }

That and an example, will not try to put it this way to be, and this is an example!

Any bug, post it here

Thank's
Title: Re: [FUNCTION] ProxDetectorS
Post by: dynavolt71 on March 19, 2014, 12:50:08 pm
What is prox ?
Title: Re: [FUNCTION] ProxDetectorS
Post by: mrockxkingbutt on March 19, 2014, 02:32:08 pm
Prox  = Distance!
Title: Re: [FUNCTION] ProxDetectorS
Post by: NeskWriter on March 19, 2014, 05:08:52 pm
What do you want it to do, Matt? Could you please describe your code?
Title: Re: [FUNCTION] ProxDetectorS
Post by: MatheuS on March 19, 2014, 05:41:38 pm
What do you want it to do, Matt? Could you please describe your code?

him and good for roleplay servers, eg set the distance between the thief and the policeman, depends on who will use, and how  ;)
Title: Re: [FUNCTION] ProxDetectorS
Post by: NeskWriter on March 20, 2014, 11:50:57 pm
I still dont get it
Title: Re: [FUNCTION] ProxDetectorS
Post by: mrockxkingbutt on March 21, 2014, 04:08:55 pm
I still dont get it

Go Buy A New Brain First!
Title: Re: [FUNCTION] ProxDetectorS
Post by: NeskWriter on March 21, 2014, 04:20:56 pm
I still dont get it

Go Buy A New Brain First!

GTFO you 10 years old angry piece of crap. God damnit I have no words to express how fucking much stupid you are
Title: Re: [FUNCTION] ProxDetectorS
Post by: NE.Restricted on March 21, 2014, 05:07:57 pm
I still dont get it

Go Buy A New Brain First!

GTFO you 10 years old angry piece of crap. God damnit I have no words to express how fucking much stupid you are
Ill make some words for you:
Gothafagokin: Stupidity of the world
Garmingofgathagin: Stupidity of the universe
Title: Re: [FUNCTION] ProxDetectorS
Post by: mrockxkingbutt on March 21, 2014, 05:50:08 pm
I still dont get it

Go Buy A New Brain First!

GTFO you 10 years old angry piece of crap. God damnit I have no words to express how fucking much stupid you are

I still dont get it

Go Buy A New Brain First!

GTFO you 10 years old angry piece of crap. God damnit I have no words to express how fucking much stupid you are
Ill make some words for you:
Gothafagokin: Stupidity of the world
Garmingofgathagin: Stupidity of the universe

@Nesk

can't even see the difference between 10 & 13 . how stupid is this crap .
Nasty SHit Of Pig!

NE.Restricted

Get The Fuck Out Of Here Swine!
Title: Re: [FUNCTION] ProxDetectorS
Post by: stormeus on March 21, 2014, 06:33:14 pm
Locked because no one can stay on topic.