public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/epr", cmdtext, true, 10) == 0)
{
if (PlayerToPoint(1, playerid, -2660.8972,1423.4766,906.4609))
{
SetPlayerPos(playerid, -2660.8555,1425.6328,906.4609);
}
else
{
SendClientMessage(playerid, 0x00FFFF00, " You're not near any private room door ");
}
}
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/epr", cmdtext, true) == 0)
{
if(PlayerToPoint(1.0, playerid, -2660.8972,1423.4766,906.4609))
{
SetPlayerPos(playerid, -2660.8555,1425.6328,906.4609);
}
else
{
SendClientMessage(playerid, 0x00FFFF00, " You're not near any private room door ");
}
return 1;
}
return 0;
}
|
Originally Posted by Jefff
return 1; U needed
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/epr", cmdtext, true) == 0)
{
if(PlayerToPoint(1.0, playerid, -2660.8972,1423.4766,906.4609))
{
SetPlayerPos(playerid, -2660.8555,1425.6328,906.4609);
}
else
{
SendClientMessage(playerid, 0x00FFFF00, " You're not near any private room door ");
}
return 1;
}
return 0;
}
|
...if (strcmp("/epr", cmdtext, true)==0) return 1;
|
Originally Posted by Annihalation
fix your PlayerToPoint
it goes (PlayerID, Radius, X, Y, Z) thats the problem, it took me a while to figure that out :/ |
stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
//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 1;
}
return 0;
}