Noticias:

Debes de estar registrado para poder ver el contenido indicado. Registrate o Conectate

Menú Principal

Mensajes recientes

#81
Desarrollo de Servidores / Zona Radioactiva
Último mensaje por Swarlog - Feb 04, 2023, 01:35 AM
/*
Zona radioactiva by smoke
Samp.forums y PawnoScripts,prohibido postear en otros foros
Puedes modificarlo tranquilamente,solo no borres esto : Creditos by smoke123
*/

#include <a_samp>
#include <streamer>
#pragma tabsize 0

new VidaTimer[MAX_PLAYERS];//Esto sera la variable que baja nuestra salud al entrar en la zona radioactiva
new smoke;
new radiacion_smoke;


public OnPlayerEnterDynamicArea(playerid, areaid)
{
if(areaid == smoke)
    {
      GameTextForPlayer(playerid, "~w~Has entrado a una zona radioactiva, ~r~ cuidado!", 4000, 3);//texto que aparecerá en la pantalla del jugador
      SetPlayerDrunkLevel(playerid,50000);
      VidaBajando(playerid);


      }
    return 1;
}

public OnPlayerLeaveDynamicArea(playerid, areaid)
{
    if(areaid == smoke)
    {
        GameTextForPlayer(playerid, "~w~Has salido de la zona radioactiva, ~b~ estas a salvo!", 4000, 3);
        SetPlayerDrunkLevel(playerid,0);
        }
    return 1;
      }

    forward VidaBajando(playerid);
    public VidaBajando(playerid)
    {
    new Float:Health;
    GetPlayerHealth(playerid,Health);
    SetPlayerHealth(playerid,Health-5);
    return VidaTimer[playerid]=SetTimerEx("VidaBajando", 3000,0,"d",playerid);
    }

public OnGameModeInit()
{
smoke = CreateDynamicRectangle(-81.74512, 1623.225, 397.0478, 2183.763, -1, -1, -1);//Si vas a cambiar la zona,cambia la coordenada
radiacion_smoke = GangZoneCreate(-93.423, 1611.547, 420.4035, 2148.729);//Lo mismo aqui
return 1;
}

public OnPlayerSpawn(playerid)
{
GangZoneShowForPlayer(playerid, radiacion_smoke, 0xFF000096);//Si quieres puedes cambiar el color,aqui esta rojo.
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
KillTimer(VidaTimer[playerid]);
return 1;
}
#82
Desarrollo de Servidores / Anti MG by Zume
Último mensaje por Swarlog - Feb 04, 2023, 01:33 AM
Sistema que evita el uso de las palabras prohibidas en el chat.

stock DetectarMetagaming(text[], sustitucion[14] = EOS)
{
    static const MetaGamings[][16] =
    {
        {"xD"},
        {"servidor"},
        {"metagaming"},
        {"server"},
        {"admin"},
        {"SA:MP"}
    };
    new
        i, count;

    while(i <= strlen(text))
    {
        for(new ex = 0; ex < sizeof(MetaGamings); ex++)
        {
            if(strfind(text,MetaGamings[ex],true,i) != -1 && strfind(text,MetaGamings[ex],true,i) == i)
            {
                if((((sustitucion[0])) || (((sustitucion[0]) != '\1') && ((sustitucion[1])))))
                {
                    strdel(text, i, i+strlen(MetaGamings[ex]));
                    for(new x = 0; x < strlen(MetaGamings[ex]); x++)
                    {
                        strins(text, sustitucion, i, strlen(MetaGamings[ex]));
                    }
                }
                count++;
            }
        }
        i++;
    }
    return ((count > 0) ? (count) : (-1));
}

public OnPlayerText(playerid, text[])
{
    new id = -1, string[128];
    id = DetectarMetagaming(text/*, "*" */); // Es posible agregar caracteres que seran agregados en las palabras MG, por ello puse ? en return 0
    if(id != -1)
    {
        format(string, sizeof(string), "No hagas metagaming, tu mensaje tiene %d palabras OOC ..", id);
        SendClientMessage(playerid, -1, string);
        //return 0; // (?)
    }
    return 1;
}
#83
Desarrollo de Servidores / Anti MG by smoke
Último mensaje por Swarlog - Feb 04, 2023, 01:31 AM
Sistema que evita el uso de las palabras prohibidas en el chat.

/*
Antimg by smoke
*/
#include <a_samp>
#if defined FILTERSCRIPT
#define Rojo         0xFE2E2E
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Anti MG by smoke");
print("--------------------------------------\n");
return 1;
}
#endif
public OnPlayerText(playerid, text[])
{
if(strfind(text, "xD", true) != -1 || strfind(text, "LOOOL", true) != -1 || strfind(text, ":D", true) != -1 || strfind(text, "-.-", true) != -1 || strfind(text, ":P", true) != -1)//Si el usuario dice..
{
SendClientMessage(playerid,0xEA7971FF,"Estas haciendo MG,dilo por /b");//Pasa esto
//Jail(playerid); ,claro si vas a sancionar users que hagan mg y tengas jail en tu gm
return 0;
}
if(strfind(text, ":C", true) != -1 || strfind(text, "o.o", true) != -1 || strfind(text, "pg", true) != -1 || strfind(text, "spam", true) != -1 || strfind(text, ":S", true) != -1)
{
SendClientMessage(playerid,0xEA7971FF,"Estas haciendo MG,dilo por /b");
return 0;
}
if(strfind(text, "Barza", true) != -1 || strfind(text, "o.o", true) != -1 || strfind(text, "madrid", true) != -1 || strfind(text, "chelsea", true) != -1 || strfind(text, "n.n", true) != -1)
{
SendClientMessage(playerid,0xEA7971FF,"Estas haciendo MG,dilo por /b");
return 0;
}
if(strfind(text, "dmero", true) != -1 || strfind(text, "o.o", true) != -1 || strfind(text, "liverpool", true) != -1 || strfind(text, "rk", true) != -1 || strfind(text, "a.a", true) != -1)
{
SendClientMessage(playerid,0xEA7971FF,"Estas haciendo MG,dilo por /b");
return 0;
}
if(strfind(text, "ck", true) != -1 || strfind(text, "ck2", true) != -1 || strfind(text, "lel", true) != -1 || strfind(text, "Mg", true) != -1 || strfind(text, "e.e", true) != -1)
{
SendClientMessage(playerid,0xEA7971FF,"Estas haciendo MG,dilo por /b");
return 0;
}
return 1;
}
#84
Soporte & Asistencia / Re:Función GivePlayerScore
Último mensaje por Swarlog - Feb 04, 2023, 01:15 AM
Debes de estar registrado para poder ver el contenido indicado. Registrate o ConectateHola buenas comunidad, ¿como podría yo añadir la función "GivePlayerScore" al gamemode?

La necesito para poder editarla para unos tops que he conseguido crear.

Añade esto al final del gamemode o donde tengas los "stock":

stock GivePlayerScore(playerid, score)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + score);
}

Así podreis utilizar dicha función en vuestro gamemode ;)
#85
Soporte & Asistencia / Re:Warning 217: loose indentat...
Último mensaje por Swarlog - Feb 04, 2023, 01:15 AM
Debes de estar registrado para poder ver el contenido indicado. Registrate o ConectateHola, he copiado un code y me aparece el siguiente error. Lo he revisado pero parece que todo esta correctamente. ¿Podrian ayudarme a solucionar este error? Esta copiado tal cual y no se si es error del codigo  :-\

CitarC:\Documents and Settings\Administrador\Escritorio\Server\test.pwn(128) : warning 217: loose indentation
Pawn compiler 3.2.3664    Copyright (c) 1997-2016, ITB CompuPhase


El error basicamente es por las tabulaciones, al copiar el code de un foro o web no guarda las separaciones/tabulaciones de línea y tienes que adaptarlas para solucionar el problema. Te doy dos métodos para solucionarlo:

1.- Editas el código manualmente mediante la tecla "Tab" de vuestro teclado y acomodas vuestro script. Opción recomendado.

2.- Añadir arriba del todo, el comando "#pragma tab size 0". De este modo solucionamos el problema, pero te aconsejo el primer método.
#86
Soporte & Asistencia / Función GivePlayerScore
Último mensaje por Kanis - Feb 04, 2023, 01:09 AM
Hola buenas comunidad, ¿como podría yo añadir la función "GivePlayerScore" al gamemode?

La necesito para poder editarla para unos tops que he conseguido crear.
#87
Soporte & Asistencia / Warning 217: loose indentation
Último mensaje por Kanis - Feb 04, 2023, 01:06 AM
Hola, he copiado un code y me aparece el siguiente error. Lo he revisado pero parece que todo esta correctamente. ¿Podrian ayudarme a solucionar este error? Esta copiado tal cual y no se si es error del codigo  :-\

CitarC:\Documents and Settings\Administrador\Escritorio\Server\test.pwn(128) : warning 217: loose indentation
Pawn compiler 3.2.3664    Copyright (c) 1997-2016, ITB CompuPhase
#88
Desarrollo de Servidores / Ocultar nombre de los jugadore...
Último mensaje por Swarlog - Feb 04, 2023, 01:02 AM
Por ejemplo, crea un comando para activarlo o desactivarlo:

if (strcmp("/nombreoff", cmdtext, true) == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, false);
    GameTextForPlayer(playerid, "~W~Nombres ~R~Desactivados!", 5000, 5);
    return 1;
}

Aqui os dejo la función:

ShowPlayerNameTagForPlayer(playerid, showplayerid, show);
  • Showplayerid: Aqui pones el nombre del usuario.
  • Show: Muestra o no el nombre (1 = Si / 0 = No)

Info Wiki --> Debes de estar registrado para poder ver el contenido indicado. Registrate o Conectate
#89
Desarrollo de Servidores / Personalizar Daño de Armas
Último mensaje por Swarlog - Feb 04, 2023, 12:51 AM
Información Adicional:

Código con el podreis añadirle a vuestro servidor algo mas de realismo con respecto al daño causado por una determinada arma u otra. Se puede configurar al gusto de cada uno.

Código:

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    new Float:HP;
    GetPlayerHealth(playerid, HP);
    if(weaponid == 24) SetPlayerHealth(playerid, HP-50);//DesertEagle
    if(weaponid == 22) SetPlayerHealth(playerid, HP-50);//Colt45
    if(weaponid == 32) SetPlayerHealth(playerid, HP-10);//Tec9
    if(weaponid == 28) SetPlayerHealth(playerid, HP-10);//Uzi
    if(weaponid == 23) SetPlayerHealth(playerid, HP-50);//SilencedColt
    if(weaponid == 31) SetPlayerHealth(playerid, HP-35);//M4
    if(weaponid == 30) SetPlayerHealth(playerid, HP-40);//AK
    if(weaponid == 29) SetPlayerHealth(playerid, HP-18);//MP5
    if(weaponid == 34) SetPlayerHealth(playerid, HP-300);//SniperRifle
    if(weaponid == 33) SetPlayerHealth(playerid, HP-35);//CuntGun
    if(weaponid == 25) SetPlayerHealth(playerid, HP-100);//PumpShotgun
    if(weaponid == 27) SetPlayerHealth(playerid, HP-70);//Spaz12
    return 1;
}
#90
Desarrollo de Servidores / Sistema de Sangrado
Último mensaje por Swarlog - Feb 04, 2023, 12:50 AM
Información Adicional:

Básicamente lo que hace es que al utilizar dicho valor, la vida del jugador va decreciendo hasta llegar a cero y mtarlo.

Código:

public OnGameModeInit()
{
    SetTimer("LifeCheck", 30000, true);
    return 1;
}

public LifeCheck()
{
    for(new i; i < GetMaxPlayers(); i++)
    {
        if(IsPlayerConnected(i))
        {
            new Float:health;
            GetPlayerHealth(i, health);
            SetPlayerHealth(i, health-1);
        }
    }
    return 1;