05.11.2012, 17:56
Esse cmd que eu fiz, faz com que o escudo seja equipa, e nгo perca vida, assim bugando, e o escudo "protegendo".
Oque eu quero й, com oque algum comando, retire o escudo...
O CMD para colocar o escudo й esse:
Eu fiz um comando para remover o escudo, mais acabou bugando na hora de colocar novamente, ele dizia que jaб estava equipado...
Esse й o cуdigo:
Aqui estб o FS inteiro:
Oque eu quero й, com oque algum comando, retire o escudo...
O CMD para colocar o escudo й esse:
pawn Код:
if(!strcmp(cmdtext, "/equipamento", true))
{
new Float:var0 = 0;
GetPlayerArmour(playerid, var0);
if(var0 > 0)
{
return SendClientMessage(playerid, 0xFF0000AA, "Vocк jб estб equipado!");
}
if(GetPlayerSkin(playerid) > 279 && GetPlayerSkin(playerid) < 289)
{
SetPlayerAttachedObject(playerid,1,19142,1,0.1,0.05,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,999999);
SendClientMessage(playerid, 0x33AA33AA, "Todos os equipamentos de policiais foi colocado com sucesso!");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Apenas policias pode equipar.");
}
return 1;
}
Esse й o cуdigo:
pawn Код:
if(!strcmp(cmdtext, "/Requipamento", true)) // Remove Attached Objects
{
for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
for(new var0 = 0; var0 < 500; var0++)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) RemovePlayerAttachedObject(playerid, 1);
if(IsPlayerAttachedObjectSlotUsed(playerid, 2)) RemovePlayerAttachedObject(playerid, 2);
if(IsPlayerAttachedObjectSlotUsed(playerid, 3)) RemovePlayerAttachedObject(playerid, 3);
if(IsPlayerAttachedObjectSlotUsed(playerid, 4)) RemovePlayerAttachedObject(playerid, 4);
if(IsPlayerAttachedObjectSlotUsed(playerid, 5)) RemovePlayerAttachedObject(playerid, 5);
SendClientMessage(playerid, 0xFF0000AA, "Equipamento retirado com sucesso!!");
}
return 1;
}
return 0;
}
Aqui estб o FS inteiro:
pawn Код:
#include <a_samp>
#include <core>
#include <float>
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xFF0000AA
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/equipamento", true))
{
new Float:var0 = 0;
GetPlayerArmour(playerid, var0);
if(var0 > 0)
{
return SendClientMessage(playerid, 0xFF0000AA, "Vocк jб estб equipado!");
}
if(GetPlayerSkin(playerid) > 279 && GetPlayerSkin(playerid) < 289)
{
SetPlayerAttachedObject(playerid,1,19142,1,0.1,0.05,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,999999);
SendClientMessage(playerid, 0x33AA33AA, "Todos os equipamentos de policiais foi colocado com sucesso!");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Apenas policias pode equipar.");
}
return 1;
}
if(!strcmp(cmdtext, "/Requipamento", true)) // Remove Attached Objects
{
for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
for(new var0 = 0; var0 < 500; var0++)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) RemovePlayerAttachedObject(playerid, 1);
if(IsPlayerAttachedObjectSlotUsed(playerid, 2)) RemovePlayerAttachedObject(playerid, 2);
if(IsPlayerAttachedObjectSlotUsed(playerid, 3)) RemovePlayerAttachedObject(playerid, 3);
if(IsPlayerAttachedObjectSlotUsed(playerid, 4)) RemovePlayerAttachedObject(playerid, 4);
if(IsPlayerAttachedObjectSlotUsed(playerid, 5)) RemovePlayerAttachedObject(playerid, 5);
SendClientMessage(playerid, 0xFF0000AA, "Equipamento retirado com sucesso!!");
}
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;
}