Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: mrockxkingbutt on February 08, 2013, 12:44:48 am

Title: Untested Function usefull (try this)
Post by: mrockxkingbutt on February 08, 2013, 12:44:48 am
this is you can insert in any cmd you want it work when you are near to that player you want to /jail/unjail/kick/ban/drown etc
i convert it from sq to pawn

Mirrorize 1
[pawn]    if (GetPlayerDistance(playerid,plr) >= 3) {
    SendClientMessage(playerid, RED, " You Have To Be Near To That Player");
    }[/pawn]

Mirrorize 2
[pawn]else if(GetPlayerDistance(playerid,plr)) SendClientMessage(playerid,COLOR_RED," You Have To Be Near ");[/pawn]

stock
[pawn]stock GetPlayerDistance( playerid, playerid2)
{
   new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
   new Float:tmpdis;
   GetPlayerPos( playerid,x1,y1,z1 );
   GetPlayerPos( playerid2,x2,y2,z2);
   tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1 ) ),2)+floatpower(floatabs(floatsub(y2,y1 ) ),2)+floatpower(floatabs(floatsub(z2,z1 ) ),2) );
   return floatround(tmpdis);
}[/pawn]

This Function Is From VCMP!

GUPS!

It Will Also Usefull When!

If You Used A Jail Command

With tHis You Can make To Work When You Are Near To Him He Will Be Jailed Otherwise he Cant be! Jailed!

So Its A UseFull Feature Discovered By me!
Title: Re: Untested Function usefull (try this)
Post by: NeskWriter on February 08, 2013, 12:58:42 am
so emm where is a stock?
Title: Re: Untested Function usefull (try this)
Post by: stormeus on February 08, 2013, 02:12:15 am
You didn't give the function GetPlayerDistance, so this won't work. Please fix it or I'll have to remove it.

EDIT: Thank you!