17.07.2010, 15:26
ok, I have setup a PlayerToPoint system, and after a couple of hours, the text that needs to show up, tot ell the player what to type to enter (like /enter) does not work. does anyone have a solution to this?
forward PlayerToPoint(Float:radi,playerid,Float:x,Float:y,Float:z); public OnPlayerCommandText(playerid, cmdtext[]) { else if (strcmp("/enter", cmdtext, true) == 0) { if(PlayerToPoint(3.0, playerid, 1554.3734,-1675.4396,16.1953)) //LSPD Station { GameTextForPlayer(playerid, "~b~ Los Santos Police Department", 3500, 3); SetPlayerInterior(playerid,6); SetPlayerPos(playerid,246.7839,63.9001,1003.6406); return 1; } return 1; } else if (strcmp("/exit", cmdtext, true) == 0) { if(PlayerToPoint(3.0, playerid, 246.5264,62.6218,1003.6406)) //LSPD Station { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1552.4254,-1675.5154,16.1953); return 1; } return 1; } } return 0; } public 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); if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { return 1; } return 0; }