#include <a_samp>#include <zcmd>#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))public OnFilterScriptInit(){print(\"\\n--------------------------------------\");print(\" Predator Script By.: Nasika \");print(\"--------------------------------------\\n\");return 1;}public OnFilterScriptExit(){return 1;}forward frissit(playerid);new Float:prex[MAX_PLAYERS],Float:prey[MAX_PLAYERS],Float:prez[MAX_PLAYERS];new frissittimer[MAX_PLAYERS];new object[MAX_PLAYERS];new bool:predator[MAX_PLAYERS] = false;CMD:predator(playerid,params[]){frissittimer[playerid] = SetTimerEx(\"frissit\",100,true,\"i\",playerid);GetPlayerPos(playerid,prex[playerid],prey[playerid],prez[playerid]);object[playerid] = CreateObject(345,prex[playerid],prey[playerid],prez[playerid]+800, 270, 0,0); SetPlayerCameraPos(playerid, prex[playerid],prey[playerid],prez[playerid]+800);SetPlayerCameraLookAt(playerid, prex[playerid],prey[playerid],prez[playerid]-1);MoveObject(object[playerid],prex[playerid],prey[playerid],0.0,50);predator[playerid] = true;TogglePlayerControllable(playerid,0);return 1;} public OnPlayerUpdate(playerid){if(predator[playerid] == true){ new Keys,ud,lr; GetPlayerKeys(playerid,Keys,ud,lr);if(ud == KEY_UP){ prex[playerid] += 5.0; MoveObject(object[playerid], prex[playerid],prey[playerid],0, 50);}if(ud == KEY_DOWN){ prex[playerid] -= 5.0; MoveObject(object[playerid], prex[playerid],prey[playerid],0, 50);}if(lr == KEY_LEFT){ prey[playerid] += 5.0; MoveObject(object[playerid], prex[playerid],prey[playerid],0, 50);}if(lr == KEY_RIGHT){ prey[playerid] -= 5.0; MoveObject(object[playerid], prex[playerid],prey[playerid],0, 50);}} return 1;}new Float:ttx[MAX_PLAYERS],Float:tty[MAX_PLAYERS],Float:ttz[MAX_PLAYERS];public frissit(playerid){GetObjectPos(object[playerid],ttx[playerid],tty[playerid],ttz[playerid]);SetPlayerCameraPos(playerid, ttx[playerid],tty[playerid],ttz[playerid]);SetPlayerCameraLookAt(playerid, ttx[playerid],tty[playerid],ttz[playerid]-1);return 1;}public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){if(predator[playerid] == true){if (PRESSED(KEY_FIRE)){ DestroyObject(object[playerid]); GetObjectPos(object[playerid],ttx[playerid],tty[playerid],ttz[playerid]); CreateExplosion(ttx[playerid],tty[playerid],ttz[playerid], 3, 4.0); CreateExplosion(ttx[playerid]+5,tty[playerid]+5,ttz[playerid], 3, 4.0); CreateExplosion(ttx[playerid]-5,tty[playerid]-5,ttz[playerid], 3, 4.0); CreateExplosion(ttx[playerid]-5,tty[playerid]+5,ttz[playerid], 3, 4.0); CreateExplosion(ttx[playerid]+5,tty[playerid]-5,ttz[playerid], 3, 4.0); KillTimer(frissittimer[playerid]); predator[playerid] = false; SetCameraBehindPlayer(playerid); TogglePlayerControllable(playerid,1);}}return 1;}
BlackJack\" post=\"456799\" timestamp=\"1377276231\"]Tetszõs szkript fel is használom!Ám kapsz egy + -t töllem. [/quote]Köszi!
Nagyon jó el lehet vele hülyéskedni
Szép lett !
Majdnem jó.Elég sok felesleges dolog van benne és van amit 1xübben, szebben is meglehetett volna oldani..Ilyen például a camera mozgatása az objecten!Gondolom még nem hallottál az AttachCameraToObject függvényrõl. http://wiki.sa-mp.com/wiki/AttachCameraToObjectEzzel nem lesz szükséged a kamerával bajlódni és az idõzítõre sem.Esetleg még azt is beletehetnéd, hogy a zuhanás közben is tudd irányítani.
public OnPlayerUpdate(playerid){if(predator[playerid] == true){ new Keys,ud,lr; GetPlayerKeys(playerid,Keys,ud,lr);if(ud == KEY_UP){ prex[playerid] += 5.0; MoveObject(object[playerid], prex[playerid],prey[playerid],0, 50);}if(ud == KEY_DOWN){ prex[playerid] -= 5.0; MoveObject(object[playerid], prex[playerid],prey[playerid],0, 50);}if(lr == KEY_LEFT){ prey[playerid] += 5.0; MoveObject(object[playerid], prex[playerid],prey[playerid],0, 50);}if(lr == KEY_RIGHT){ prey[playerid] -= 5.0; MoveObject(object[playerid], prex[playerid],prey[playerid],0, 50);}} return 1;}