Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Sistema Hora feliz By Badyx
- */
- /*
- Tiempo 12 minutos
- Script Badyx
- Desarrollo Badyx
- Tester Badyx
- Creditos adicionales: Wiki.sa-mp
- Imagenes:
- http://imageshack.us/scaled/landing/211/desea.jpg
- http://imageshack.us/scaled/landing/402/acth.jpg
- */
- /* Includes */
- #include <a_samp>
- /* Macros */
- #define funcion%0(%1) \
- forward %0(%1); \
- public %0(%1)
- /* News */
- new EstadoHoraFeliz = 0;
- /* Inicio del Script */
- #if defined FILTERSCRIPT
- #else
- main(){}
- #endif
- /* Esto no es necesario y lo pueden borrar */
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[Info] Este servidor cuenta con sistema Hora Feliz.");
- return 1;
- }
- /* Comandos del FileScript */
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new string[100];
- /* Este comando es una prueba de como hacer que solo funcionen algunos comandos solo si la hora feliz esta activada */
- if (strcmp("/Prueba", cmdtext, true, 10) == 0)
- {
- if(EstadoHoraFeliz == 1)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}Funcionaria el comando.");
- return 1;
- }
- return SendClientMessage(playerid, -1, "{FFFFFF}La hora feliz no esta activada.");
- }
- /* Comando para comprobar el estado de la hora feliz */
- if (strcmp("/EstadoHora", cmdtext, true, 10) == 0)
- {
- if(EstadoHoraFeliz == 1)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}El modo hora feliz esta activada!.");
- return 1;
- }
- return SendClientMessage(playerid, -1, "{FFFFFF}El modo hora feliz esta desactivado!.");
- }
- /* Comando para activar la hora feliz. Requiere estar logeado con la Rcon */
- if (strcmp("/HoraFeliz", cmdtext, true, 10) == 0)
- {
- if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, -1, "{FFFFFF}Necesitas estar logeado con Rcon para usar este comando.");
- if(EstadoHoraFeliz != 1)
- {
- EstadoHoraFeliz = 1;
- format(string, sizeof(string), "{FFFFFF}La hora feliz ha sido activada por {CDE878}%s, {FFFFFF}A {519760}Trol{FFFFFF}ear.", NombreEx(playerid));
- SendClientMessageToAll(-1, string);
- return 1;
- }
- else
- {
- EstadoHoraFeliz = 0;
- SendClientMessageToAll(-1, "{FFFFFF}La hora feliz ha sido {F80F60}desactivada.");
- return 1;
- }
- }
- return 0;
- }
- /* Detecta cuando vamos a entrar en un coche */
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- new Float:slx, Float:sly, Float:slz;
- if(EstadoHoraFeliz != 1)
- {
- if(EsVehiculoGuerra(GetPlayerVehicleID(playerid)) && !ispassenger)
- {
- return 1;
- }
- else
- {
- GetPlayerPos(playerid, slx, sly, slz);
- SetPlayerPos(playerid, slx, sly, slz+2);
- SendClientMessage(playerid, -1, "{FFFFFF}[Error] Estos vehiculos solo estan disponibles en hora feliz.");
- return 1;
- }
- }
- return 1;
- }
- /* Si desean crear mas restricciones tienen que añadir mas modelos */
- /* Todas las ids de coches en
- http://wiki.sa-mp.com/wiki/Vehicles:All
- */
- funcion EsVehiculoGuerra(vehicleid)
- { new model = GetVehicleModel(vehicleid);
- // if(model == IDCOCHE || model == IDCOCHE ||model == IDCOCHE ||model == IDCOCHE) Este es el formato para añadir mas coches
- if(model == 432 || model == 520)//Tanque y Hidra
- {
- return 1;
- }
- return 0;
- }
- /* Funcion que obtiene el nombre del administrador que activa la hora feliz */
- stock NombreEx(playerid)
- {
- new string[24];
- GetPlayerName(playerid,string,24);
- new str[24];
- strmid(str,string,0,strlen(string),24);
- for(new i = 0; i < MAX_PLAYER_NAME; i++)
- {
- if (str[i] == '_') str[i] = ' ';
- }
- return str;
- }
- //============================================================================//
- // //
- // FINAL DEL SCRIPT //
- // //
- // SI TE SIRVIO, RESPETA EL TRABAJO DEL CREADOR //
- // //
- //============================================================================//
Advertisement
Add Comment
Please, Sign In to add comment