Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This IS a COMMENT
- // uncomment the line below IF you want TO WRITE a filterscript
- //#define FILTERSCRIPT
- #include <a_samp>
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 2 //Testing purpose
- PUBLIC OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- SetTimer("RunThroughPlayers", 30, 1);
- RETURN 1;
- }
- PUBLIC OnFilterScriptExit()
- {
- RETURN 1;
- }
- PUBLIC OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- RETURN 1;
- }
- PUBLIC OnPlayerConnect(playerid)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerDisconnect(playerid, reason)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerSpawn(playerid)
- {
- NEW FLOAT:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- SetPlayerCameraPos(playerid, Pos[0], Pos[1], Pos[2]);
- SetPlayerCameraLookAt(playerid, Pos[0], Pos[1] + 20, Pos[2]);
- SetPVarInt(playerid, "Spawned", 1);
- RETURN 1;
- }
- PUBLIC OnPlayerDeath(playerid, killerid, reason)
- {
- DeletePVar(playerid, "Spawned");
- RETURN 1;
- }
- PUBLIC OnVehicleSpawn(vehicleid)
- {
- RETURN 1;
- }
- PUBLIC OnVehicleDeath(vehicleid, killerid)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerText(playerid, text[])
- {
- RETURN 1;
- }
- PUBLIC OnPlayerCommandText(playerid, cmdtext[])
- {
- IF (strcmp("/kill", cmdtext, TRUE, 3) == 0)
- {
- SetPlayerHealth(playerid, 0);
- RETURN 1;
- }
- RETURN 0;
- }
- PUBLIC OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerExitVehicle(playerid, vehicleid)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerStateChange(playerid, newstate, oldstate)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerEnterCheckpoint(playerid)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerLeaveCheckpoint(playerid)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerEnterRaceCheckpoint(playerid)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerLeaveRaceCheckpoint(playerid)
- {
- RETURN 1;
- }
- PUBLIC OnRconCommand(cmd[])
- {
- RETURN 1;
- }
- PUBLIC OnPlayerRequestSpawn(playerid)
- {
- RETURN 1;
- }
- PUBLIC OnObjectMoved(objectid)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerObjectMoved(playerid, objectid)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerPickUpPickup(playerid, pickupid)
- {
- RETURN 1;
- }
- PUBLIC OnVehicleMod(playerid, vehicleid, componentid)
- {
- RETURN 1;
- }
- PUBLIC OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- RETURN 1;
- }
- PUBLIC OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerSelectedMenuRow(playerid, ROW)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerExitedMenu(playerid)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- RETURN 1;
- }
- PUBLIC OnRconLoginAttempt(ip[], password[], success)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerUpdate(playerid)
- {/*
- static tc;
- printf("TC: %d ", GetTickCount() - tc);
- tc = GetTickCount();
- if(!GetPVarInt(playerid, "Spawned")) return 1;
- new Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- SetPlayerCameraLookAt(playerid, Pos[0], Pos[1], Pos[2]);
- SetPlayerCameraPos(playerid, Pos[0] + (floatdiv(Pos[0], 1000)), Pos[1] + (floatdiv(Pos[1], 1000)), Pos[2] + ((!IsPlayerInAnyVehicle(playerid)) ? (12.5) : (12.5 + floatdiv(GetPlayerSpeed(playerid), 5))));*/
- RETURN 1;
- }
- forward RunThroughPlayers();
- PUBLIC RunThroughPlayers()
- {
- FOR(NEW playerid; playerid < MAX_PLAYERS; playerid++)
- {
- IF(!GetPVarInt(playerid, "Spawned")) RETURN;
- SetPlayerCameraLookAt(playerid, 0, 5000, 0);
- NEW FLOAT:Pos[4];
- IF(IsPlayerInAnyVehicle(playerid))
- {
- GetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
- GetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
- }
- ELSE
- {
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(playerid, Pos[3]);
- }
- Pos[0] += ((IsPlayerInAnyVehicle(playerid)) ? (floatdiv(((GetPlayerSpeed(playerid) + 3.75) *floatsin(-Pos[3], degrees)), 4.5)) : (1.25 * floatsin(-Pos[3], degrees)));
- Pos[1] += ((IsPlayerInAnyVehicle(playerid)) ? (floatdiv(((GetPlayerSpeed(playerid) + 3.75) *floatcos(-Pos[3], degrees)), 4.5)) : (1.25 * floatcos(-Pos[3], degrees)));
- SetPlayerCameraLookAt(playerid, Pos[0], Pos[1], Pos[2]);
- SetPlayerCameraPos(playerid, Pos[0] + (floatdiv(Pos[0], 1000)), Pos[1] + (floatdiv(Pos[1], 1000)), Pos[2] + ((!IsPlayerInAnyVehicle(playerid)) ? (12.5) : (12.5 + floatdiv(GetPlayerSpeed(playerid), 5))));
- }
- }
- PUBLIC OnPlayerStreamIn(playerid, forplayerid)
- {
- RETURN 1;
- }
- PUBLIC OnPlayerStreamOut(playerid, forplayerid)
- {
- RETURN 1;
- }
- PUBLIC OnVehicleStreamIn(vehicleid, forplayerid)
- {
- RETURN 1;
- }
- PUBLIC OnVehicleStreamOut(vehicleid, forplayerid)
- {
- RETURN 1;
- }
- PUBLIC OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- RETURN 1;
- }
- PUBLIC OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- RETURN 1;
- }
- stock GetPlayerSpeed(playerid)
- {
- NEW FLOAT:ST[4];
- IF(IsPlayerInAnyVehicle(playerid))
- GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
- ELSE GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
- ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 100.3;
- RETURN floatround(ST[3]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement