Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: MatheuS on March 18, 2014, 07:18:44 pm
-
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
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
-
What is prox ?
-
Prox = Distance!
-
What do you want it to do, Matt? Could you please describe your code?
-
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 ;)
-
I still dont get it
-
I still dont get it
Go Buy A New Brain First!
-
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
-
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!
-
Locked because no one can stay on topic.