[Duda] Quitar mensajes log disparos y bug arcas
#1

Buenas, quisiera comentar que cuando disparas un arma sale un mensaje y quiero retirarlo y que no salga mбs, el cуdigo es el siguiente:

pawn Код:
Guns_OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_FIRE))
    {
        new weapon = GetPlayerWeapon(playerid);
        new target = NOEXISTE;
        switch(weapon)
        {
            case 23:
            {
                if(IsACop(playerid) || IsAMedic(playerid))
                {
                    if(PlayerInfo[playerid][pFrozenTaser] == 1){ GameTextForPlayer(playerid, "~r~ESPERA - RECARGA", 2000, 3); return 1;}
                    for(new i; i < MAX_PLAYERS; i++)
                    {
                        if(i == playerid) continue;
                       
                        if(!IsPlayerConnected(i)) continue;
                       
                        if(IsPlayerAimingAtPlayer(playerid, i))
                        {
                            target = i;
                            break;
                        }
                    }
                   
                    if(target != NOEXISTE)
                    {
                        if(GetDistanceBetweenPlayers(playerid, target) < 15)
                        {
                            TogglePlayerControllable(target, 0);
                            ApplyAnimation(target,"CRACK","crckdeth1",4.1,0,1,1,1,1,1);
                            GameTextForPlayer(target, "~r~Paralizado", 1000, 3);
                            format(string, sizeof(string), "* Has sido paralizado por %s por 40 segundos.", pName(playerid));
                            SendClientMessage(target, AzulClaro, string);
                            format(string, sizeof(string), "* Has paralizado a %s por 40 segundos.", pName(target));
                            SendClientMessage(playerid, AzulClaro, string);
                            format(string, sizeof(string), "* %s dispara su Tazer a %s, y lo paraliza.", pName(playerid), pName(target));
                            ProxDetector(20.0, playerid, string, Morado, Morado, Morado, Morado, Morado);
                            PlayerInfo[target][pTempFrozen] = 1;
                            SetTimerEx("DescongelarTazer", 40000, 0, "i", target);
                        }
                    }
                    PlayerInfo[playerid][pFrozenTaser] = 1;
                    SetTimerEx("DelayTaser", 3000, 0, "i", playerid);
                }
                else
                {
                    SafeResetPlayerWeaponsAC(playerid);
                    SendClientMessage(playerid, Rojo, "* Detectada arma invбlida.");
                }
                return 1;
            }
            case 8:
            {
                format(string, sizeof(string), "* Escuchas disparos");
                ProxDetector(60.0, playerid, string,Morado, Morado, Morado, Morado, Morado);
                if(IsPlayerAimingBodyPart(playerid, 1) != INVALID_PLAYER_ID)
                {
                    target = IsPlayerAimingBodyPart(playerid, 1);
                    if(PlayerInfo[target][pHerido] == 0 && IsPlayerLookingAtPlayer(playerid, target))
                    {
                        if(GetDistanceBetweenPlayers(playerid, target) < 800)
                        {
                            GM_SetPlayerHealth(target, 0);
                        }
                    }
                }
                return 1;
            }
            case 34, 33:
            {
                format(string, sizeof(string), "* Escuchas disparos");
                ProxDetector(60.0, playerid, string,Morado, Morado, Morado, Morado, Morado);
                if(IsPlayerAimingBodyPart(playerid, 1) != INVALID_PLAYER_ID)
                {
                    target = IsPlayerAimingBodyPart(playerid, 1);
                    if(PlayerInfo[target][pHerido] == 0 && IsPlayerLookingAtPlayer(playerid, target))
                    {
                        if(GetDistanceBetweenPlayers(playerid, target) < 800)
                        {
                            GM_SetPlayerHealth(target, 0);
                            format(string, 128, "Has disparado en la cabeza al usuario %s.", pName(target));
                            SendClientMessage(playerid, Naranja, string);
                            format(string, 128, "Te han disparado en la cabeza.", pName(target));
                            SendClientMessage(target, Naranja, string);
                            GameTextForPlayer(playerid, "~r~HeadShot!", 3000, 5);
                        }
                    }
                }
                else if(IsPlayerAimingBodyPart(playerid, 2) != INVALID_PLAYER_ID)
                {
                    target = IsPlayerAimingBodyPart(playerid, 2);
                    if(PlayerInfo[target][pHerido] == 0 && IsPlayerLookingAtPlayer(playerid, target))
                    {
                        if(GetDistanceBetweenPlayers(playerid, target) < 800)
                        {
                            new Float:Vida, dano, Float:Armor;
                            GetPlayerArmour(target, Armor);
                            if(Armor > 0)
                            {
                                dano = random (5) + 5;
                                format(string, 128, "Has disparado a %s y le has dado en el cuerpo.", pName(target));
                                SendClientMessage(playerid, Naranja, string);
                                format(string, 128, "Te han disparado en el cuerpo.", pName(target));
                                SendClientMessage(target, Naranja, string);
                                SetPlayerArmour(target, Armor - dano);
                            }
                            else
                            {
                                GetPlayerHealth(target, Vida);
                                dano = random (25) + 50;
                                format(string, 128, "Has disparado a %s y le has dado en el cuerpo.", pName(target));
                                SendClientMessage(playerid, Naranja, string);
                                format(string, 128, "Te han disparado en el cuerpo.", pName(target));
                                SendClientMessage(target, Naranja, string);
                                GM_SetPlayerHealth(target, Vida - dano);
                            }
                        }
                    }
                }
                return 1;
            }
            case 22, 24, 32:
            {
                format(string, sizeof(string), "* Escuchas disparos");
                ProxDetector(60.0, playerid, string,Morado, Morado, Morado, Morado, Morado);
                if(IsPlayerAimingBodyPart(playerid, 1) != INVALID_PLAYER_ID)
                {
                    target = IsPlayerAimingBodyPart(playerid, 1);
                    if(PlayerInfo[target][pHerido] == 0 && IsPlayerLookingAtPlayer(playerid, target))
                    {
                        if(GetDistanceBetweenPlayers(playerid, target) < 30)
                        {
                            GM_SetPlayerHealth(target, 0);
                            format(string, 128, "Has disparado a %s y le has dado en la cabeza.", pName(target));
                            SendClientMessage(playerid, Naranja, string);
                            format(string, 128, "Te han disparado en la cabeza.", pName(target));
                            SendClientMessage(target, Naranja, string);
                            GameTextForPlayer(playerid, "~r~HeadShot!", 3000, 5);
                        }
                    }
                }
                else if(IsPlayerAimingBodyPart(playerid, 2) != INVALID_PLAYER_ID)
                {
                    target = IsPlayerAimingBodyPart(playerid, 2);
                    if(PlayerInfo[target][pHerido] == 0 && IsPlayerLookingAtPlayer(playerid, target))
                    {
                        if(GetDistanceBetweenPlayers(playerid, target) < 30)
                        {
                            new Float:Vida, dano, Float:Armor;
                            GetPlayerArmour(target, Armor);
                            if(Armor > 0)
                            {
                                dano = random (5) + 5;
                                format(string, 128, "Has disparado a %s y le has dado en el brazo.", pName(target));
                                SendClientMessage(playerid, Naranja, string);
                                format(string, 128, "Te han disparado en el brazo.", pName(target));
                                SendClientMessage(target, Naranja, string);
                                SetPlayerArmour(target, Armor - dano);
                            }
                            else
                            {
                                GetPlayerHealth(target, Vida);
                                dano = random (15) + 10;
                                format(string, 128, "Has disparado a %s y le has dado en el brazo.", pName(target));
                                SendClientMessage(playerid, Naranja, string);
                                format(string, 128, "Te han disparado en el brazo.", pName(target));
                                SendClientMessage(target, Naranja, string);
                                GM_SetPlayerHealth(target, Vida - dano);
                            }
                        }
                    }
                }
                return 1;
            }
            case 28, 29:
            {
                format(string, sizeof(string), "* Escuchas disparos");
                ProxDetector(60.0, playerid, string,Morado, Morado, Morado, Morado, Morado);
                if(IsPlayerAimingBodyPart(playerid, 1) != INVALID_PLAYER_ID)
                {
                    target = IsPlayerAimingBodyPart(playerid, 1);
                    if(PlayerInfo[target][pHerido] == 0 && IsPlayerLookingAtPlayer(playerid, target))
                    {
                        if(GetDistanceBetweenPlayers(playerid, target) < 20)
                        {
                            GM_SetPlayerHealth(target, 0);
                            format(string, 128, "Has disparado a %s y le has dado en la cabeza.", pName(target));
                            SendClientMessage(playerid, Naranja, string);
                            format(string, 128, "Te han disparado en la cabeza.", pName(target));
                            SendClientMessage(target, Naranja, string);
                            GameTextForPlayer(playerid, "~r~HeadShot!", 3000, 5);
                        }
                    }
                }
                else if(IsPlayerAimingBodyPart(playerid, 2) != INVALID_PLAYER_ID)
                {
                    target = IsPlayerAimingBodyPart(playerid, 2);
                    if(PlayerInfo[target][pHerido] == 0 && IsPlayerLookingAtPlayer(playerid, target))
                    {
                        if(GetDistanceBetweenPlayers(playerid, target) < 30)
                        {
                            new Float:Vida, dano, Float:Armor;
                            GetPlayerArmour(target, Armor);
                            if(Armor > 0)
                            {
                                dano = random (5) + 5;
                                format(string, 128, "Has disparado a %s y le has dado en el cuerpo.", pName(target));
                                SendClientMessage(playerid, Naranja, string);
                                format(string, 128, "Te han disparado en el cuerpo.", pName(target));
                                SendClientMessage(target, Naranja, string);
                                SetPlayerArmour(target, Armor - dano);
                            }
                            else
                            {
                                GetPlayerHealth(target, Vida);
                                format(string, 128, "Has disparado a %s y le has dado en el cuerpo.", pName(target));
                                SendClientMessage(playerid, Naranja, string);
                                format(string, 128, "Te han disparado en el cuerpo.", pName(target));
                                SendClientMessage(target, Naranja, string);
                                dano = random (10) + 30;
                                GM_SetPlayerHealth(target, Vida - dano);
                            }
                        }
                    }
                }
                return 1;
            }
            case 31, 30:
            {
                format(string, sizeof(string), "* Escuchas disparos");
                ProxDetector(60.0, playerid, string,Morado, Morado, Morado, Morado, Morado);
                if(IsPlayerAimingBodyPart(playerid, 1) != INVALID_PLAYER_ID)
                {
                    target = IsPlayerAimingBodyPart(playerid, 1);
                    if(PlayerInfo[target][pHerido] == 0 && IsPlayerLookingAtPlayer(playerid, target))
                    {
                        if(GetDistanceBetweenPlayers(playerid, target) < 50)
                        {
                            GM_SetPlayerHealth(target, 0);
                            format(string, 128, "Has disparado a %s y le has dado en la cabeza.", pName(target));
                            SendClientMessage(playerid, Naranja, string);
                            format(string, 128, "Te han disparado en la cabeza.", pName(target));
                            SendClientMessage(target, Naranja, string);
                            GameTextForPlayer(playerid, "~r~HeadShot!", 3000, 5);
                        }
                    }
                }
                else if(IsPlayerAimingBodyPart(playerid, 2) != INVALID_PLAYER_ID)
                {
                    target = IsPlayerAimingBodyPart(playerid, 2);
                    if(PlayerInfo[target][pHerido] == 0 && IsPlayerLookingAtPlayer(playerid, target))
                    {
                        if(GetDistanceBetweenPlayers(playerid, target) < 30)
                        {
                            new Float:Vida, dano, Float:Armor;
                            GetPlayerArmour(target, Armor);
                            if(Armor > 0)
                            {
                                dano = random (5) + 5;
                                format(string, 128, "Has disparado a %s y le has dado en el cuerpo.", pName(target));
                                SendClientMessage(playerid, Naranja, string);
                                format(string, 128, "Te han disparado en el cuerpo.", pName(target));
                                SendClientMessage(target, Naranja, string);
                                SetPlayerArmour(target, Armor - dano);
                            }
                            else
                            {
                                GetPlayerHealth(target, Vida);
                                format(string, 128, "Has disparado a %s y le has dado en el cuerpo.", pName(target));
                                SendClientMessage(playerid, Naranja, string);
                                format(string, 128, "Te han disparado en el cuerpo.", pName(target));
                                SendClientMessage(target, Naranja, string);
                                dano = random (5) + 15;
                                GM_SetPlayerHealth(target, Vida - dano);
                            }
                        }
                    }
                }
                return 1;
            }
            case 25, 26, 27:
            {
                format(string, sizeof(string), "* Escuchas disparos");
                ProxDetector(60.0, playerid, string,Morado, Morado, Morado, Morado, Morado);
                if(IsPlayerAimingBodyPart(playerid, 1) != INVALID_PLAYER_ID)
                {
                    target = IsPlayerAimingBodyPart(playerid, 1);
                    if(PlayerInfo[target][pHerido] == 0 && IsPlayerLookingAtPlayer(playerid, target))
                    {
                        if(GetDistanceBetweenPlayers(playerid, target) < 15)
                        {
                            GM_SetPlayerHealth(target, 0);
                            format(string, 128, "Has disparado a %s y le has dado en la cabeza.", pName(target));
                            SendClientMessage(playerid, Naranja, string);
                            format(string, 128, "Te han disparado en la cabeza.", pName(target));
                            SendClientMessage(target, Naranja, string);
                            GameTextForPlayer(playerid, "~r~HeadShot!", 3000, 5);
                        }
                    }
                }
                else if(IsPlayerAimingBodyPart(playerid, 2) != INVALID_PLAYER_ID)
                {
                    target = IsPlayerAimingBodyPart(playerid, 2);
                    if(PlayerInfo[target][pHerido] == 0 && IsPlayerLookingAtPlayer(playerid, target))
                    {
                        if(GetDistanceBetweenPlayers(playerid, target) < 30)
                        {
                            new Float:Vida, dano, Float:Armor;
                            GetPlayerArmour(target, Armor);
                            if(Armor > 0)
                            {
                                dano = random (5) + 5;
                                format(string, 128, "Has disparado a %s y le has dado en el cuerpo.", pName(target));
                                SendClientMessage(playerid, Naranja, string);
                                format(string, 128, "Te han disparado en el cuerpo.", pName(target));
                                SendClientMessage(target, Naranja, string);
                                SetPlayerArmour(target, Armor - dano);
                            }
                            else
                            {
                                GetPlayerHealth(target, Vida);
                                format(string, 128, "Has disparado a %s y le has dado en el cuerpo.", pName(target));
                                SendClientMessage(playerid, Naranja, string);
                                format(string, 128, "Te han disparado en el cuerpo.", pName(target));
                                SendClientMessage(target, Naranja, string);
                                dano = random (10) + 30;
                                GM_SetPlayerHealth(target, Vida - dano);
                            }
                        }
                    }
                }
                return 1;              
            }
        }
    }
    return 0;
}
Despues tengo un bug en las arcas al igual que la gasolinera, para capar esto que solo puedan poner hasta X cantidad, usando el comando de las arcas:

/ARCAS ID SACAR 99999999999999999999999999999999999

Код:
	if(strcmp(cmd, "/arcas", true) == 0)
	{
		if(PlayerInfo[playerid][pMember] == 5 && PlayerInfo[playerid][pRank] == 6 || PlayerInfo[playerid][pAdmin] == 4)
		{
			tmp = strtokex(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, Blanco, "USO: /arcas [1-2-3-4-5-7][Nombre] [Cantidad]");
				return 1;
			}
			for(new i = 0; i < sizeof(ArcasInfo); i++)
			{
	 			new llave = strval(tmp);
	    		if (ArcasInfo[i][aId] == llave)
	      		{
	         		tmp2 = strtokex(cmdtext, idx);
					if(!strlen(tmp2))
					{
						SendClientMessage(playerid, Blanco, "USO: /arcas [1-2-3-4-5-7][Nombre] [Cantidad]");
						SendClientMessage(playerid, AzulClaro, "Arcas: Ver, Sacar, Depositar");
						return 1;
					}
					if(strcmp(tmp2,"Ver",true) == 0)
	 				{
						new dueno[15];
						if(ArcasInfo[i][aOwner] == 0) dueno = "Gobierno";
						else if(ArcasInfo[i][aOwner] == 1) dueno = "LSPD";
						else if(ArcasInfo[i][aOwner] == 2) dueno = "LSMD";
						else if(ArcasInfo[i][aOwner] == 3) dueno = "LSTD";
						else if(ArcasInfo[i][aOwner] == 4) dueno = "San News";
						else if(ArcasInfo[i][aOwner] == 5) dueno = "Gobierno";
						else if(ArcasInfo[i][aOwner] == 7) dueno = "LSJD";
						else if(ArcasInfo[i][aOwner] == 10) dueno = "Idlewod";
						else if(ArcasInfo[i][aOwner] == 11) dueno = "Las Flores";
						else if(ArcasInfo[i][aOwner] == 12) dueno = "Jefferson";
						else if(ArcasInfo[i][aOwner] > 0) format(dueno,sizeof(dueno),"%d",ArcasInfo[i][aOwner]);

						format(string,sizeof(string), "------%s------[%d]", ArcasInfo[i][aNameArca], ArcasInfo[i][aId]);
						SendClientMessage(playerid, Naranja, string);
						format(string,sizeof(string), "Dueсo: %s ", dueno);
						SendClientMessage(playerid, AmarilloClaro, string);
						format(string,sizeof(string), "Total $$: %d$",ArcasInfo[i][aDinero]);
						SendClientMessage(playerid, AmarilloClaro, string);
						if(ArcasInfo[i][aId] == 2)
						{
							format(string,sizeof(string), "Sangre: %d",ArcasInfo[i][aSangre]);
							SendClientMessage(playerid, AmarilloClaro, string);
						}
						if(ArcasInfo[i][aId] == 4)
						{
							format(string,sizeof(string), "Fondos: %d$",ArcasInfo[i][aFondos]);
							SendClientMessage(playerid, AmarilloClaro, string);
						}
					}

					if(strcmp(tmp2,"Sacar",true) == 0)
	 				{
	  					new money;
	    				tmp3 = strtokex(cmdtext, idx);
						money = strval(tmp3);
						if(!strlen(tmp3) || !IsNumeric(tmp3)) { SendClientMessage(playerid, Blanco, "USO: /arcas [1-2-3-4-5][Nombre] [Cantidad]"); return 1; }
						if(ArcasInfo[i][aDinero] < money)
						{
							SendClientMessage(playerid, Rojo, "* Cantidad Incorrecta.");
							return 1;
						}
						ArcasInfo[i][aDinero] -= money;
						SaveArcas(i);
						SafeGivePlayerMoney(playerid, money);
						format(string,sizeof(string), "Has sacado: %d$", money);
	 					SendClientMessage(playerid, AmarilloClaro, string);
					}

					if(strcmp(tmp2,"Depositar",true) == 0)
	 				{
	  					new money;
	    				tmp3 = strtokex(cmdtext, idx);
						money = strval(tmp3);
						if(!strlen(tmp3) || !IsNumeric(tmp3)) { SendClientMessage(playerid, Blanco, "USO: /arcas [1-2-3-4-5][Nombre] [Cantidad]"); return 1; }
						if(SafeGetPlayerMoney(playerid) >= money)
						{
							ArcasInfo[i][aDinero] += money;
							SaveArcas(i);
							SafeGivePlayerMoney(playerid, - money);
	  						format(string,sizeof(string), "Has depositado: %d$", money);
	       					SendClientMessage(playerid, AmarilloClaro, string);
						}
						else
						{
							SendClientMessage(playerid, Rojo, "* Cantidad incorrecta");
						}
					}
				}
			}
		}
		else
		{
		    SendClientMessage(playerid, Rojo, "No perteneces a una facciуn pъblica o no eres un alto rango");
		}
		return 1;
	}
Reply
#2

їQuieres que te digan como hacerlo o que te pasen el cуdigo ya hecho? No se, si en 2 aсos no has aprendido a quitar un mensaje, entonces esto no es lo tuyo... Si es lo segundo, mбs de uno estarнa dispuesto a hacerlo a cambio de cuatro perras.
Reply
#3

Buenas bm0z, si, en 2 aсos he estado trabajando y cosas de la vida, no me he puesto a aprender a scriptear. Si eres scripter y sabes...їPorque no contactas conmigo por TS? Buscamos scripter y PAGAMOS...

Y sobre el codigo, decirme como o pasarlo echo me es indiferente... porque nose como es para limitar una cantidad.
Reply
#4

Jajaja le ofreces a un dios trabajar en algo que tu no sabes remover unos mensajes? xD

Quote:

SendClientMessage

Quote:

GameTextForPlayer

Reply
#5

Quote:
Originally Posted by wharlos
Посмотреть сообщение
Jajaja le ofreces a un dios trabajar en algo que tu no sabes remover unos mensajes? xD
Un dios? Como si es el rey de espaсa jajaja, estoy ofreciendo trabajar en un proyecto serio y ъnico, y no, no es el sendclient mirate el codigo... el mensaje es: Escuchas disparos.
Reply
#6

Borre
Quote:

format(string, sizeof(string), "* Escuchas disparos");
ProxDetector(60.0, playerid, string,Morado, Morado, Morado, Morado, Morado);

Reply
#7

Te recomiendo leer la Wiki SA-MP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)