Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Copyright © Guardar
- ______________________________________________________________________________________________
- | |
- | * Sistema creado por Ygzeb para guardar datos de forma sencilla en SA-MP. |
- |______________________________________________________________________________________________|
- FilterScript - [FS]Guardar
- ----------------------------
- */
- //==============================================================================
- // Include.
- //==============================================================================
- #include <a_samp>
- //==============================================================================
- // Anti-Amx.
- //==============================================================================
- AntiAmx()
- {
- new a[][] =
- {
- "Unarmed (Fist)",
- "Brass K"
- };
- #pragma unused a
- }
- //==============================================================================
- // Define colors.
- //==============================================================================
- #define Basic 0xFE9D01AA
- #define Complex 0x1AFF00AA
- #define Blank 0xFFFFFFAA
- //==============================================================================
- //------------------------------------------------------------------------------
- // Publics.
- //------------------------------------------------------------------------------
- //==============================================================================
- //==============================================================================
- // Public - OnFilterScriptInit.
- //==============================================================================
- public OnFilterScriptInit()
- {
- AntiAmx();
- return 1;
- }
- //==============================================================================
- // Public - OnFilterScriptExit.
- //==============================================================================
- public OnFilterScriptExit()
- {
- AntiAmx();
- return 1;
- }
- //==============================================================================
- // Public - OnPlayerCommandText.
- //==============================================================================
- //==============================================================================
- // Command.
- //==============================================================================
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/Pos", true))
- {
- new Text[100], Float: X, Float: Y, Float: Z, Float: Angle, Name[MAX_PLAYER_NAME], Year, Month, Day, Hour, Minute, Second;
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, Angle);
- gettime(Second, Minute, Hour);
- getdate(Day, Month, Year);
- GetPlayerName(playerid, Name, sizeof(Name));
- format(Text, sizeof(Text), "| Fecha de guardado: %02d/%02d/%04d | Hora de guardado: %02d:%02d:%02d |", Day, Month, Year, Hour, Minute, Second);
- Saved(Text);
- SendClientMessage(playerid, Basic, Text);
- format(Text, sizeof(Text), "[<!>] Posición: %0.2f, %0.2f, %0.2f | Ángulo: %0.2f | Nombre: %s", X, Y, Z, Angle, Name);
- Saved(Text);
- SendClientMessage(playerid, Blank, Text);
- format(Text, sizeof(Text), "[<!>] Mundo virtual: %d | Interior: %d ", GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
- Saved(Text);
- SendClientMessage(playerid, Blank, Text);
- return 1;
- }
- if(!strcmp(cmdtext, "/Script", true))
- {
- new Text[100], Float: X, Float: Y, Float: Z, Float: Angle, Year, Month, Day, Hour, Minute, Second;
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, Angle);
- gettime(Hour, Minute, Second);
- getdate(Year, Month, Day);
- format(Text, sizeof(Text), "| Fecha de script: %02d/%02d/%04d | Hora de script: %02d:%02d:%02d |", Day, Month, Year, Hour, Minute, Second);
- Script(Text);
- SendClientMessage(playerid, Complex, Text);
- format(Text, sizeof(Text), "SetPlayerPos(playerid, %0.2f, %0.2f, %0.2f);", X, Y, Z);
- Script(Text);
- SendClientMessage(playerid, Blank, Text);
- format(Text, sizeof(Text), "SetPlayerFacingAngle(playerid, %0.2f);", Angle);
- Script(Text);
- SendClientMessage(playerid, Blank, Text);
- format(Text, sizeof(Text), "SetPlayerVirtualWorld(playerid, %d);", GetPlayerVirtualWorld(playerid));
- Script(Text);
- SendClientMessage(playerid, Blank, Text);
- format(Text, sizeof(Text), "SetPlayerInterior(playerid, %d);", GetPlayerInterior(playerid));
- Script(Text);
- SendClientMessage(playerid, Blank, Text);
- format(Text, sizeof(Text), "SetCameraBehindPlayer(playerid);");
- Script(Text);
- SendClientMessage(playerid, Blank, Text);
- return 1;
- }
- if(!strcmp(cmdtext, "/Guardar", true))
- {
- SendClientMessage(playerid, Basic, "{FFFFFF}Sistema de {FFA600}guardado {FFFFFF}creado por {00FF15}Ygzeb {FFFFFF}de {FFA600}Flare Entertainment.");
- return 1;
- }
- return 0;
- }
- //==============================================================================
- // Stock - Save.
- //==============================================================================
- stock Saved(str[])
- {
- new File:log = fopen("Guardado.txt", io_append);
- format(str, 256, "%s\r\n", str);
- fwrite(log, str);
- fclose(log);
- return 1;
- }
- //==============================================================================
- // Stock - Script.
- //==============================================================================
- stock Script(str[])
- {
- new File:log = fopen("Script.txt", io_append);
- format(str, 256, "%s\r\n", str);
- fwrite(log, str);
- fclose(log);
- return 1;
- }
- // © Flare Entertainment - Todos los derechos reservados.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement