Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*=========================================================================
- This Ramping Filterscript is made by Jeffry
- Made in January 2010.
- Your Rights:
- -You are allowed to modify this Filterscript, aslong as you DO NOT remove credits or re-upload it.
- -You are NOT allowed to re-upload this Filterscript.
- -You are NOT allowed to claim this as your own.
- -You are NOT allowed to remove any credits.
- Thank you.
- Have fun. I would be happy if you give me /credits. :D
- ===========================================================================*/
- #include <a_samp>
- new bool:CreatedRamp[MAX_PLAYERS];
- new Enabled[MAX_PLAYERS];
- new Ramp;
- new Pers[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n----------------------------------");
- print(" [FS] Ramping by Jeffry - Loaded -");
- print("----------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- new i = 0;
- while(i < MAX_PLAYERS)
- {
- CreatedRamp[i] = false;
- DestroyPlayerObject(i, Ramp);
- i++;
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- if(CreatedRamp[playerid] == true) DestroyPlayerObject(playerid, Ramp), CreatedRamp[playerid] = false;
- CreatedRamp[playerid] = false;
- Enabled[playerid]=0;
- Pers[playerid]=0;
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Enabled[playerid]=0;
- Pers[playerid]=0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/ramping", cmdtext, true, 10) == 0)
- {
- if(Enabled[playerid] == 1)
- {SendClientMessage(playerid, 0xFFFF00FF, "Ramping disabled!");
- Enabled[playerid]=0;
- Pers[playerid]=0;
- return 1;
- }
- if(Enabled[playerid] == 0)
- {
- SendClientMessage(playerid, 0xFFFF00FF, "Ramping enabled!");
- SendClientMessage(playerid, 0xFFFF00FF, "Press the Special Action Key ( Strg or Alt Gr ) to create a ramp!");
- Enabled[playerid]=1;
- Pers[playerid]=1655;
- return 1;
- }
- }
- if (strcmp("/my ramp 1", cmdtext, true, 10) == 0)
- {
- if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
- SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 1!");
- Pers[playerid]=1655;
- return 1;
- }
- if (strcmp("/my ramp 2", cmdtext, true, 10) == 0)
- {
- if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
- SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 2!");
- Pers[playerid]=1632;
- return 1;
- }
- if (strcmp("/my ramp 3", cmdtext, true, 10) == 0)
- {
- if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
- SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 3!");
- Pers[playerid]=1631;
- return 1;
- }
- if (strcmp("/my ramp 4", cmdtext, true, 10) == 0)
- {
- if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
- SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 4!");
- Pers[playerid]=8302;
- return 1;
- }
- if (strcmp("/my ramp 5", cmdtext, true, 10) == 0)
- {
- if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
- SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 5!");
- Pers[playerid]=1503;
- return 1;
- }
- if (strcmp("/my ramp", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, 0xFF0000FF, "Usage: /my ramp [1-5]!");
- return 1;
- }
- if (strcmp("/ramphelp", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, 0xFF0000FF, "Welcome to the Ramping-Info!");
- SendClientMessage(playerid, 0xFFFFFFFF, "• Use /ramping to enable ramping.");
- SendClientMessage(playerid, 0xFFFFFFFF, "• Use /my ramp [1-5] to change the type of your ramp.");
- SendClientMessage(playerid, 0xFFFFFFFF, "• To create a ramp use Special Action Key ( ''Strg'' or ''Alt Gr'' )");
- SendClientMessage(playerid, 0xFFFFFFFF, "• To disable ramping type /ramping again.");
- SendClientMessage(playerid, 0xFFFF00FF, "This Filterscript was made by [WsR]RyDeR and Jeffry.");
- return 1;
- }
- return 0;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(Enabled[playerid] == 1)
- {
- if (IsPlayerInAnyVehicle(playerid))
- {
- if((newkeys & KEY_ACTION) && !(oldkeys & KEY_ANALOG_UP))
- {
- switch(GetVehicleModel( GetPlayerVehicleID(playerid) )) {
- case 592,577,511,512,593,520,553,476,519,460,513,487,488,548,425,417,497,563,447,469:
- return 1;
- }
- if(CreatedRamp[playerid] == true) DestroyPlayerObject(playerid, Ramp), CreatedRamp[playerid] = false;
- new Float:pX,Float:pY,Float:pZ,Float:vA, Arabam = GetPlayerVehicleID(playerid);
- GetVehiclePos(Arabam, pX, pY, pZ);
- GetVehicleZAngle(Arabam, vA);
- Ramp = CreatePlayerObject(playerid, Pers[playerid], pX + (20.0 * floatsin(-vA, degrees)), pY + (20.0 * floatcos(-vA, degrees)), pZ, 0, 0, vA);
- CreatedRamp[playerid] = true;
- SetTimerEx("destroy", 4000,0,"d",playerid);
- }
- }
- }
- return 1;
- }
- forward destroy(playerid);
- public destroy(playerid)
- {
- if(CreatedRamp[playerid]==true) {
- return DestroyPlayerObject(playerid, Ramp), CreatedRamp[playerid] = false;
- }else return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement