Guest User

Untitled

a guest
Nov 1st, 2015
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2. {
  3. if(newkeys == KEY_SECONDARY_ATTACK) // ULAZIUENTERIJERE
  4. {
  5. if(GetPlayerState(playerid) == 1) InterijerUlaz(playerid);
  6. }
  7. return 1;
  8. }
  9.  
  10.  
  11. //~~~~~~~~~~~[Ulaz]~~~~~~~~~~~~//
  12. forward UlazUintRazdaljina(Float:radi, playerid, Float:x, Float:y, Float:z, Float:curx, Float:cury, Float:curz);
  13. public UlazUintRazdaljina(Float:radi, playerid, Float:x, Float:y, Float:z, Float:curx, Float:cury, Float:curz)
  14. {
  15. if(IsPlayerConnected(playerid))
  16. {
  17. new Float:tempposx, Float:tempposy, Float:tempposz;
  18. tempposx = (curx -x);
  19. tempposy = (cury -y);
  20. tempposz = (curz -z);
  21. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) return 1;
  22. }
  23. return 0;
  24. }
  25. ///////////////////////////////////////////////////
  26. stock InterijerUlaz(playerid)
  27. {
  28. new Float:cx, Float:cy, Float:cz; GetPlayerPos(playerid, cx, cy, cz);
  29. /////////////////////////////////////////////////////////////////////////////
  30. if( UlazUintRazdaljina(2, playerid, 1467.3324,-1010.6683,26.8438,cx,cy,cz ) ) //banka ulaz
  31. {
  32. SetPlayerPos(playerid, 1468.7821,-1008.0630,17.3886);
  33. SetPlayerInterior(playerid, 0);
  34. TogglePlayerControllable(playerid, 0);
  35. freeze[playerid] = SetTimerEx("Freeze",2000, false, "i", playerid);
  36. }
  37. else if( UlazUintRazdaljina(2, playerid, 1468.7821,-1008.0630,17.3886,cx,cy,cz ) ) //banka izlaz
  38. {
  39. SetPlayerPos(playerid, 1467.3324,-1010.6683,26.8438);
  40. SetPlayerInterior(playerid, 0);
  41. }
  42. /////////////////////////////////////////////////////////////////////////////////
  43. return 1;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment