SA-MP Forums Archive
Aparece e some em segundos (Escudo). - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: Aparece e some em segundos (Escudo). (/showthread.php?tid=387772)



Aparece e some em segundos (Escudo). - davi54723 - 26.10.2012

Galera, criei um simples sistema de escudo que й de enfeite.

Mais o problema dele й que ele aparece em uns 2 seg e some...

Alguйm pode ajudar?

Код:
#include <a_samp>
#include <core>
#include <float>

#define COLOR_GREEN 0x33AA33AA

	public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp(cmdtext, "/eq", true))
	{
		new Float:var0 = 0.0;
		GetPlayerArmour(playerid, var0);
		if(var0 > 0)
		{
			return SendClientMessage(playerid, 0xFDE39DAA, "Vocк Ja Esta Equipado!.");
		}
		if(GetPlayerSkin(playerid) > 279 && GetPlayerSkin(playerid) < 289)
		{
		if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
		SetPlayerAttachedObject(playerid, 1, 18637, 4, 0.3, 0, 0, 0, 170, 270, 1, 1, 1);
   	    SetPlayerAttachedObject(playerid, 2,18641, 5, 0.1, 0.02, -0.05, 0, 0, 0, 1, 1, 1);
		}
		else
		{
			SendClientMessage(playerid, 0x33AA33AA, "Equipamento colocado.");
		}
		return 1;
	}
	return 0;
}



Re: Aparece e some em segundos (Escudo). - mau.tito - 26.10.2012

pawn Код:
if(GetPlayerSkin(playerid) > 279 && GetPlayerSkin(playerid) < 289)
        {
        if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
              // ?? junto com a outra funзao???



        SetPlayerAttachedObject(playerid, 1, 18637, 4, 0.3, 0, 0, 0, 170, 270, 1, 1, 1);
        SetPlayerAttachedObject(playerid, 2,18641, 5, 0.1, 0.02, -0.05, 0, 0, 0, 1, 1, 1);
        }
        else
        {
            SendClientMessage(playerid, 0x33AA33AA, "Equipamento colocado.");
        }



Re: Aparece e some em segundos (Escudo). - davi54723 - 26.10.2012

Ja resolvi, ficou assim:


Quote:

#include <a_samp>
#include <core>
#include <float>


public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/escudo", true))
{
new Float:var0 = 0;
GetPlayerArmour(playerid, var0);
if(var0 > 0)
{
return SendClientMessage(playerid, 0xFDE39DAA, "Vocк ja equipou.");
}
if(GetPlayerSkin(playerid) > 279 && GetPlayerSkin(playerid) < 289)
{
SetPlayerAttachedObject(playerid,1,19142,1,0.1,0.0 5,0.0,0.0,0.0,0.0);
SetPlayerAttachedObject(playerid,2,19141,2,0.11,0. 0,0.0,0.0,0.0,0.0);
SetPlayerAttachedObject(playerid,3, 18637, 4, 0.3, 0, 0, 0, 170, 270, 1, 1, 1);
SetPlayerAttachedObject(playerid,4,18642,7,0.1,0.0 ,-0.11,0.0,-90.0,90.0);
SetPlayerAttachedObject(playerid,5,18641, 5, 0.1, 0.02, -0.05, 0, 0, 0, 1, 1, 1);
GivePlayerWeapon(playerid, 3, 1);
SetPlayerArmour(playerid, playerid);
SendClientMessage(playerid, 0xFDE39DAA, "Equipamentos colocado!");
}
else
{
SendClientMessage(playerid, 0xFDE39DAA, "Vocк nao й policial.");
}
return 1;
}
return 0;
}

public OnPlayerUpdate(playerid)
{
new Float:var0 = 0;
GetPlayerArmour(playerid, var0);
if(var0 < 1)
{
RemovePlayerAttachedObject(playerid, 1);
}
return 1;
}

public OnFilterScriptExit()
{
for(new var0 = 0; var0 < 500; var0++)
{
RemovePlayerAttachedObject(var0, 1);
RemovePlayerAttachedObject(var0, 2);
RemovePlayerAttachedObject(var0, 3);
RemovePlayerAttachedObject(var0, 4);
RemovePlayerAttachedObject(var0, 5);
}
return 1;
}

Sу preciso saber como faзo para deixar o colete full?


Re: Aparece e some em segundos (Escudo). - Wendell - 26.10.2012

Quote:
Originally Posted by davi54723
Посмотреть сообщение
Ja resolvi, ficou assim:





Sу preciso saber como faзo para deixar o colete full?
pawn Код:
SetPlayerArmour(playerid, 100);
SetPlayerHealth(playerid, 100);
Usa isso para dar vida e colete 100 ao player , espero ter ajudado .