Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys == KEY_SECONDARY_ATTACK) // ULAZIUENTERIJERE
- {
- if(GetPlayerState(playerid) == 1) InterijerUlaz(playerid);
- }
- return 1;
- }
- //~~~~~~~~~~~[Ulaz]~~~~~~~~~~~~//
- forward UlazUintRazdaljina(Float:radi, playerid, Float:x, Float:y, Float:z, Float:curx, Float:cury, Float:curz);
- public UlazUintRazdaljina(Float:radi, playerid, Float:x, Float:y, Float:z, Float:curx, Float:cury, Float:curz)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:tempposx, Float:tempposy, Float:tempposz;
- tempposx = (curx -x);
- tempposy = (cury -y);
- tempposz = (curz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) return 1;
- }
- return 0;
- }
- ///////////////////////////////////////////////////
- stock InterijerUlaz(playerid)
- {
- new Float:cx, Float:cy, Float:cz; GetPlayerPos(playerid, cx, cy, cz);
- /////////////////////////////////////////////////////////////////////////////
- if( UlazUintRazdaljina(2, playerid, 1467.3324,-1010.6683,26.8438,cx,cy,cz ) ) //banka ulaz
- {
- SetPlayerPos(playerid, 1468.7821,-1008.0630,17.3886);
- SetPlayerInterior(playerid, 0);
- TogglePlayerControllable(playerid, 0);
- freeze[playerid] = SetTimerEx("Freeze",2000, false, "i", playerid);
- }
- else if( UlazUintRazdaljina(2, playerid, 1468.7821,-1008.0630,17.3886,cx,cy,cz ) ) //banka izlaz
- {
- SetPlayerPos(playerid, 1467.3324,-1010.6683,26.8438);
- SetPlayerInterior(playerid, 0);
- }
- /////////////////////////////////////////////////////////////////////////////////
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment