- Vaše ime na forumu: P47R14RCH- Komanda x Funkcija:ProxDetector(Float:radius, playerid, const input[], c1, c2, c3, c4, c5, va_args<>)
{
new
string,
Float:pPosX,
Float:pPosY,
Float:pPosZ,
Float:oldpPosX,
Float:oldpPosY,
Float:oldpPosZ,
Float:tmpPosX,
Float:tmpPosY,
Float:tmpPosZ;
va_format(string, sizeof string, input, va_start<8>);
GetPlayerPos(playerid, oldpPosX, oldpPosY, oldpPosZ);
foreach(new i : StreamedPlayer)
{
GetPlayerPos(i, pPosX, pPosY, pPosZ);
tmpPosX = (oldpPosX -pPosX);
tmpPosY = (oldpPosY -pPosY);
tmpPosZ = (oldpPosZ -pPosZ);
if(((tmpPosX < radi/16) && (tmpPosX > -radi/16)) && ((tmpPosY < radi/16) && (tmpPosY > -radi/16)) && ((tmpPosZ < radi/16) && (tmpPosZ > -radi/16)))
{
SendClientMessage(i, c1, string);
}
else if(((tmpPosX < radi/8) && (tmpPosX > -radi/8)) && ((tmpPosY < radi/8) && (tmpPosY > -radi/8)) && ((tmpPosZ < radi/8) && (tmpPosZ > -radi/8)))
{
SendClientMessage(i, c2, string);
}
else if(((tmpPosX < radi/4) && (tmpPosX > -radi/4)) && ((tmpPosY < radi/4) && (tmpPosY > -radi/4)) && ((tmpPosZ < radi/4) && (tmpPosZ > -radi/4)))
{
SendClientMessage(i, c3, string);
}
else if(((tmpPosX < radi/2) && (tmpPosX > -radi/2)) && ((tmpPosY < radi/2) && (tmpPosY > -radi/2)) && ((tmpPosZ < radi/2) && (tmpPosZ > -radi/2)))
{
SendClientMessage(i, c4, string);
}
else if(((tmpPosX < radi) && (tmpPosX > -radi)) && ((tmpPosY < radi) && (tmpPosY > -radi)) && ((tmpPosZ < radi) && (tmpPosZ > -radi)))
{
SendClientMessage(i, c5, string);
}
}
return 1;
}
- Opis: Ovo je isto kao: public ProxDetector(Float:radi, playerid, string[],c1,c2,c3,c4,c5)
{
if(IsPlayerConnected(playerid))
{
new Float:pPosX, Float:pPosY, Float:pPosZ;
new Float:oldpPosX, Float:oldpPosY, Float:oldpPosZ;
new Float:tmpPosX, Float:tmpPosY, Float:tmpPosZ;
GetPlayerPos(playerid, oldpPosX, oldpPosY, oldpPosZ);
foreach(Player,i)
{
if(IsPlayerConnected(i))
{
if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
{
GetPlayerPos(i, pPosX, pPosY, pPosZ);
tmpPosX = (oldpPosX -pPosX);
tmpPosY = (oldpPosY -pPosY);
tmpPosZ = (oldpPosZ -pPosZ);
if(((tmpPosX < radi/16) && (tmpPosX > -radi/16)) && ((tmpPosY < radi/16) && (tmpPosY > -radi/16)) && ((tmpPosZ < radi/16) && (tmpPosZ > -radi/16)))
{
SendClientMessage(i, c1, string);
}
else if(((tmpPosX < radi/8) && (tmpPosX > -radi/8)) && ((tmpPosY < radi/8) && (tmpPosY > -radi/8)) && ((tmpPosZ < radi/8) && (tmpPosZ > -radi/8)))
{
SendClientMessage(i, c2, string);
}
else if(((tmpPosX < radi/4) && (tmpPosX > -radi/4)) && ((tmpPosY < radi/4) && (tmpPosY > -radi/4)) && ((tmpPosZ < radi/4) && (tmpPosZ > -radi/4)))
{
SendClientMessage(i, c3, string);
}
else if(((tmpPosX < radi/2) && (tmpPosX > -radi/2)) && ((tmpPosY < radi/2) && (tmpPosY > -radi/2)) && ((tmpPosZ < radi/2) && (tmpPosZ > -radi/2)))
{
SendClientMessage(i, c4, string);
}
else if(((tmpPosX < radi) && (tmpPosX > -radi)) && ((tmpPosY < radi) && (tmpPosY > -radi)) && ((tmpPosZ < radi) && (tmpPosZ > -radi)))
{
SendClientMessage(i, c5, string);
}
} }
}
}
return 1;
}
samo 200000% opt- Dodatak: Nisam testirao ali trebalo bi da radi, mozete napraviti macro da skratite funkciju, primer kako se koristi:// %p je iz formatex-a
// X11_PLUM_1..X11_PLUM_5 je iz y_colours-a
// playerid na kraju je 'macro' za GetName(playerid) (%p)
ProxDetector(15.0, playerid, "* %p is the best.", X11_PLUM_5, X11_PLUM_4, X11_PLUM_3, X11_PLUM_2, X11_PLUM_1, playerid);
- Credits: //- Slike: //