Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- 888888888888888888888888888888888888888888
- 88 NADE-PARKOURING LEVEL CREATOR 88
- 888888888888888888888888888888888888888888
- 88 - AUTHOR: Badjouras 88
- 88 (aka hbzi @ forum.sa-mp.com) 88
- 88 - VERSION: 1.0 88
- 88 - LAST UPDATE: 15/07 88
- 888888888888888888888888888888888888888888
- 88 - CHANGELOG: 88
- 88 88
- 888888888888888888888888888888888888888888
- */
- // * INCLUDES * //
- #include <a_samp>
- #include <Dini>
- #include <zcmd>
- // * DEFINES FUNCS * //
- #define Msg SendClientMessage
- #define MsgAll SendClientMessageToAll
- // * CONSTANTES * //
- #define DIALOG_START 1221
- #define DIALOG_END 1222
- #define MAX_FILES 100
- // * VARS * //
- new str[128];
- new fileInUse[128];
- new bool:startP = false;
- // * STOCKS * //
- stock LastFile()
- {
- new file[128];
- new i;
- for (i=1; i<MAX_FILES; i++)
- {
- format(file, sizeof(file), "parkour/%d.txt", i);
- if(!dini_Exists(file)) return i;
- }
- return 1;
- }
- // * FUNCS * //
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Nade Parkour Level Editor by Badjouras");
- print("--------------------------------------\n");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_START:
- {
- if(response)
- {
- format(str, sizeof(str), "parkour/%d.txt", LastFile());
- format(fileInUse, sizeof(fileInUse), "%s", str);
- dini_Create(fileInUse);
- new Float:pos[4];
- GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- GetPlayerFacingAngle(playerid, pos[3]);
- dini_FloatSet(fileInUse, "posIX", pos[0]);
- dini_FloatSet(fileInUse, "posIY", pos[1]);
- dini_FloatSet(fileInUse, "posIZ", pos[2]);
- dini_FloatSet(fileInUse, "angI", pos[3]);
- startP = true;
- }
- }
- case DIALOG_END:
- {
- if(response)
- {
- new Float:pos[3];
- GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- dini_FloatSet(fileInUse, "posFX", pos[0]);
- dini_FloatSet(fileInUse, "posFY", pos[1]);
- dini_FloatSet(fileInUse, "posFZ", pos[2]);
- startP = false;
- format(str, sizeof(str), "Level %d saved as %s", LastFile()-1, fileInUse);
- Msg(playerid, -1, str);
- }
- }
- }
- }
- // * COMANDOS * //
- CMD:pos(playerid, params[])
- {
- new Float:pos[4];
- GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- GetPlayerFacingAngle(playerid, pos[3]);
- format(str, sizeof(str), "{FF0000}X: {FFFFFF}%f\n{FF0000}Y: {FFFFFF}%f\n{FF0000}Z: {FFFFFF}%f\n{FF0000}Rotation: {FFFFFF}%f", pos[0], pos[1], pos[2], pos[3]);
- if(startP == false) ShowPlayerDialog(playerid, DIALOG_START, 0, "Actual Position", str, "Save Start", "Cancel");
- else ShowPlayerDialog(playerid, DIALOG_END, 0, "Actual Position", str, "Save End", "Cancel");
- return 1;
- }
- CMD:nades(playerid, params[])
- {
- ResetPlayerWeapons(playerid);
- GivePlayerWeapon(playerid, 16, 9999);
- SetPlayerHealth(playerid, 9999999);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment