Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ________________________
- ___ __ \__ __ \_ ___/
- __ / / /_ /_/ /____ \
- _ /_/ /_ ____/____/ /
- /_____/ /_/ /____/
- Made by DiGiTaL AnGeL
- */
- #define FILTERSCRIPT
- //______________________________INCLUDES________________________________________
- #include <a_samp>
- #include <YSI\y_commands>
- //_______________________________DEFINES________________________________________
- #define SCM SendClientMessage
- public OnFilterScriptInit()
- {
- print("=-=-=-=-=-=LOADED=-=-=-=-=-=");
- print("= DiGitaL position saver =");
- print("= by DiGiTaL_AnGeL =");
- print("=-=-=-=-=-=LOADED=-=-=-=-=-=");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("=-=-=-=-=-UNLOADED-=-=-=-=-=");
- print("= DiGitaL position saver =");
- print("= by DiGiTaL_AnGeL =");
- print("=-=-=-=-=-UNLOADED-=-=-=-=-=");
- return 1;
- }
- //______________________________COMMANDS________________________________________
- YCMD:savepos(playerid, params[], help)
- {
- if(help)
- {
- SCM(playerid, 0x30303090, "This cmd allows you to easily save your position for 3 different functions.");
- }
- else
- {
- if(!IsPlayerAdmin(playerid))
- {
- SCM(playerid, 0xFF0000FF, "You are not authorized to do that!");
- }
- else
- {
- if(isnull(params))
- {
- SCM(playerid, 0x394562FF, "USAGE** {FFFFFF}/savepos [type] [comment]");
- SCM(playerid, 0x394562FF, "TYPES : 1. SetPlayerPos | 2. IsPlayerInRangeOfPoint | 3. PlayerToPoint ");
- }
- else
- {
- new fstring[128];
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- new File:dpos = fopen("digital_positions.txt", io_append);
- if(dpos)
- {
- if(!strcmp(params, "1", true))
- {
- format(fstring, sizeof(fstring), "\n SetPlayerPos(playerid, %f, %f, %f);//%s\r", x, y, z, params[2]);
- fwrite(dpos, fstring);
- }
- else if(!strcmp(params, "2", true))
- {
- format(fstring, sizeof(fstring), "\n IsPlayerInRangeOfPoint(playerid, 5.0, %f, %f, %f) //%s\r", x, y, z, params[2]);
- fwrite(dpos, fstring);
- }
- else if(!strcmp(params, "3", true))
- {
- format(fstring, sizeof(fstring), "\n PlayerToPoint(5.0, playerid, %f, %f, %f) //%s\r", x, y, z, params[2]);
- fwrite(dpos, fstring);
- }
- fclose(dpos);
- return 1;
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment