Originally Posted by Taz86[Life's Good Roleplay
]
Quote:
Originally Posted by armyoftwo
and this at the end of the script
Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
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;
}
Код:
if(strcmp(cmd, "/enter", true) == 0) {
if(PlayerToPoint(25.0,playerid,1331.5435,-631.6592,109.1349))//LS Outside
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome Home!");
SetPlayerPos(playerid, 2003.1180, 2413.1821, 10.8494);
}
return 1;
}
if(strcmp(cmd, "/exit", true) == 0) {
if(PlayerToPoint(25.0,playerid,2003.1180, 2413.1821, 10.8494))//Inside House
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Have A Good-Day!");
SetPlayerPos(playerid, 1331.5435,-631.6592,109.1349);
}
return 1;
}
return 0;
}
|
Thank you very much
Can be locked
|