Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*******************************************************************************
- *********************************************
- * Lawedan Labs *
- * Los Angeles, California *
- *********************************************
- (C)Lawedan Labs 2009-2011. All Rights Reserved.
- ******************** TERMS OF USE ****************************************
- 1.0 WHAT IS LAWEDAN LABS
- ----1.1 Our Services
- Lawedan Labs is a gaming enterprise, which main duty is to create high quality
- servers and "scripts" for gaming communities, aswell as softwares to improve
- the experience while inside the game.
- As we are a private enterprise, we require each member to accept our terms of
- use. If you have reached this script, you have previously accepted our terms
- of service.
- 2.0 DEFINITIONS
- A "Script", is a set of instructions executed based on another software.
- Lawedan Labs currently uses "Scripts" for San Andreas Multiplayer, which
- at the same time is a modification of The Rockstar Games Grand Theft Auto
- San Andreas.
- "TOU", is the acronym for Terms Of Use, which is the text you are currently reading,
- this text defines what the user can do and what the user can't do.
- "TOS", is the acronym for Terms Of Service, which is accepted upon requesting
- to download any of our scripts.
- 3.0 ACCEPTANCE
- ----2.1 What am I accepting?
- Upon using this script, you are accepting this Terms of Use, and our
- Lawedan Labs Terms Of Service, found at our CEO's Blog,
- deskoft.tumblr.com.
- 4.0 THIS SCRIPT
- ----4.1 What is this Script?
- This script is the Lawedan Labs Useful Functions (lluf.inc),
- which is a include for San Andreas Multiplayer.
- ----4.2 Release
- This script is currently being released in the sa-mp forums and in my blog,
- by using this script you accept that at no time you will get profit from this
- script, you accept not to delete the credits from this script, and you
- accept to follow our Terms of Service.
- ________________________________________________________________________________
- ******************************************************************************** */
- // #define Accept // <- Uncomment that if you accept the Terms of Service.
- #include <a_samp>
- #if defined Accept
- /*
- native DisableEnterExitPaySpray(No Params Needed)
- native PlayerName(playerid)
- native IsPlayerDriver(playerid)
- native IsPlayerPassenger(playerid)
- native Create3DTextLabel(text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, virtualworld, testLOS)
- */
- #define startup main(){}
- startup
- forward OnPlayerShootPlayer(playerid, victimid);
- stock Daf__OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- // Credits to whoever made it
- if(((oldkeys & KEY_FIRE) && !(newkeys & KEY_FIRE)) || ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE)) || (newkeys & KEY_FIRE))
- {
- for(new i = 0; i < GetMaxPlayers(); i++)
- {
- if(IsPlayerConnected(i) && playerid != i && !IsPlayerNPC(i))
- {
- if(IsPlayerAiming(playerid, i) && GetPlayerState(i) != PLAYER_STATE_WASTED)
- {
- OnPlayerShootPlayer(playerid, i);
- }
- }
- }
- }
- return 1;
- }
- stock IsPlayerAiming(playerid, aimid)
- {
- // Credits to Whoever made it
- new Float:X1, Float:Y1, Float:Z1, Float:X2, Float:Y2, Float:Z2;
- GetPlayerPos(playerid, X1, Y1, Z1);
- GetPlayerPos(aimid, X2, Y2, Z2);
- new Float:Distance = floatsqroot(floatpower(floatabs(X1-X2), 2) + floatpower(floatabs(Y1-Y2), 2));
- if(Distance < 100)
- {
- new Float:A;
- GetPlayerFacingAngle(playerid, A);
- X1 += (Distance * floatsin(-A, degrees));
- Y1 += (Distance * floatcos(-A, degrees));
- Distance = floatsqroot(floatpower(floatabs(X1-X2), 2) + floatpower(floatabs(Y1-Y2), 2));
- if(Distance < 0.5)
- {
- return true;
- }
- }
- return false;
- }
- stock DisableEnterExitPaySpray()
- {
- CreateObject(974, 720.11761474609, -462.47760009766, 17.578575134277, 0, 0, 0);
- CreateObject(974, 2071.2622070313, -1831.3481445313, 14.521961212158, 0, 0, 89.622436523438);
- CreateObject(974, 1041.3873291016, -1025.708984375, 32.809097290039, 0, 0, 0);
- CreateObject(974, 1024.9073, -1029.1785, 32.3793, 0.0000, 0.0000, 0.0000);
- CreateObject(974, 1041.5345, -1025.7608, 32.3793, 0.0000, 0.0000, 0.0000);
- CreateObject(974, 2644.8608, -2039.4061, 13.0777, 0.0000, 0.0000, 0.0000);
- }
- stock GetClientName(playerid)
- {
- if(!IsPlayerConnected)
- {
- return 0;
- }
- new playername[128];
- GetPlayerName(playerid, playername, sizeof(playername));
- return playername;
- }
- stock IsPlayerDriver(playerid)
- {
- new playerstate = GetPlayerState(playerid);
- if(playerstate == PLAYER_STATE_DRIVER)
- {
- return 1;
- }else{
- return 0;
- }
- }
- stock IsPlayerPassenger(playerid)
- {
- new playerstate = GetPlayerState(playerid);
- if(playerstate == PLAYER_STATE_PASSENGER)
- {
- return 1;
- }else{
- return 0;
- }
- }
- stock compile(buf[]) {
- // udb_hash, credits to the original creator.
- new length=strlen(buf);
- new s1 = 1;
- new s2 = 0;
- new n;
- for (n=0; n<length; n++)
- {
- s1 = (s1 + buf[n]) % 65521;
- s2 = (s2 + s1) % 65521;
- }
- return (s2 << 16) + s1;
- }
- /*
- native SendClientSubtitle(playerid, subtitle[]);
- */
- new Text:Subtitle[MAX_PLAYERS];
- stock LOnGameModeInit()
- {
- for(new playerid=0; playerid<MAX_PLAYERS;playerid++)
- {
- Subtitle[playerid] = TextDrawCreate(147, 367, "Subtitlehere");
- TextDrawFont(Subtitle[playerid] , 1);
- TextDrawLetterSize(Subtitle[playerid] , 0.3, 2.1);
- TextDrawColor(Subtitle[playerid] , 0xFFFFFFFF);
- TextDrawSetOutline(Subtitle[playerid] , 0);
- TextDrawSetProportional(Subtitle[playerid] , 1);
- TextDrawSetShadow(Subtitle[playerid] , 1);
- }
- }
- forward HideSubtitle(playerid);
- public HideSubtitle(playerid)
- {
- TextDrawHideForPlayer(playerid, Subtitle[playerid]);
- }
- stock SendClientSubtitles(playerid, subtitle[])
- {
- if(IsPlayerConnected(playerid))
- {
- TextDrawSetString(Subtitle[playerid], subtitle);
- TextDrawShowForPlayer(playerid, Subtitle[playerid]);
- SetTimerEx("HideSubtitle", strlen(subtitle)*100, false, "u", playerid);
- }
- }
- /*
- native SetPlayerCheckpointEx(playerid, cpid, Float:x, Float:y, Float:z, Float:size);
- */
- new checkpointid[MAX_PLAYERS];
- forward OnPlayerEnterCheckpointEx(playerid, cpid);
- stock LOnPlayerEnterCheckpoint(playerid)
- {
- OnPlayerEnterCheckpointEx(playerid, checkpointid[playerid]);
- }
- stock SetPlayerCheckpointEx(playerid, cpid, Float:x, Float:y, Float:z, Float:size)
- {
- if(IsPlayerConnected(playerid) == 1)
- {
- SetPlayerCheckpoint(playerid, x, y, z, size);
- checkpointid[playerid] = cpid;
- }
- }
- #else
- #error You need to accept the terms of use in the lluf.inc (Do this by typing #define Accept)
- #endif
Advertisement
Add Comment
Please, Sign In to add comment