Tenho o comando /batercartao nas Orgs e para desiquipar basta voltar a escrever o mesmo comando sу que nгo remove as armas. Tentei de uma forma mas se eu tiver armas compradas e for equipar e passado algum tempo desiquipar perco as todas. Alguma forma de retirar as armas que sгo adicionadas quando e inserido o /batercartao?
Код:
if(strcmp(cmd, "/batercartao", true) == 0)
{
if(PlayerInfo[playerid][pJailed] != 0)
{
SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode batercartao na cadeia!");
return true;
}
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsACop(playerid))
{
if(PlayerToPoint(2,playerid,1530.3060,-1702.4915,6.2252) || PlayerToPoint(2,playerid,326.6374,307.1123,999.1484) || PlayerToPoint(2,playerid,302.7936,-1529.9443,24.9219) || PlayerToPoint(2,playerid,240.6516,112.8062,1003.2188) || PlayerToPoint(2,playerid,255.1123,77.4241,1003.6406) || PlayerToPoint(2,playerid,229.8059,164.7830,1003.0234)
|| PlayerToPoint(2,playerid,-1521.1884,462.9987,7.1875) || PlayerToPoint(2,playerid,712.7550,-554.5677,-3.5950) || PlayerToPoint(2,playerid,-1588.4751,732.4855,-4.9063))
{
if(OnDuty[playerid]==0)
{
SetPVarInt(playerid, "Skin_O", GetPlayerSkin(playerid));
new rand = random(sizeof (SkinsPoliciaDP));
SetPlayerSkin(playerid, SkinsPoliciaDP[rand]);
format(string, sizeof(string), "Oficial %s esta Fardado.", sendername);
SendClientMessageToAll(COLOR_DBLUE,string);
format(string, sizeof(string), "* O Policial %s Pegou seus equipamentos", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
//SetPlayerAttachedObject(playerid,3,18637,13,0.35,0.0,0.0,0.0,0.0,180.0);
VidaDoCara[playerid] = 2; AXITERCOLETE[playerid] = 3;
GivePlayerWeaponBPH(playerid, 24, 150);
GivePlayerWeaponBPH(playerid, 25, 250);
SetPlayerArmour(playerid, 100);
SetPlayerHealth(playerid, 100);
OnDuty[playerid] = 1;
EmpregoDuty[playerid] = 2;
Copsronda += 1;
}
else if(OnDuty[playerid]==1)
{
SetPlayerSkin(playerid, GetPVarInt(playerid, "Skin_O"));
DeletePVar(playerid, "Skin_O");
format(string, sizeof(string), "Oficial %s esta de Folga.", sendername);
SendClientMessageToAll(COLOR_DBLUE,string);
format(string, sizeof(string), "* O Policial %s guardou seus equipamentos", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
//RemovePlayerAttachedObject(playerid,3);
OnDuty[playerid] = 0;
EmpregoDuty[playerid] = 0;
Copsronda -= 1;
}
}
}
}
return true;
}
Nгo esta a funcionar, quando desiquipo as armas ficam na mesma. Alguem sabe como resolver?
tenta ae
pawn Код:
if(strcmp(cmd, "/batercartao", true) == 0)
{
if(PlayerInfo[playerid][pJailed] != 0)
{
SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode batercartao na cadeia!");
return true;
}
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsACop(playerid))
{
if(PlayerToPoint(2,playerid,1530.3060,-1702.4915,6.2252) || PlayerToPoint(2,playerid,326.6374,307.1123,999.1484) || PlayerToPoint(2,playerid,302.7936,-1529.9443,24.9219) || PlayerToPoint(2,playerid,240.6516,112.8062,1003.2188) || PlayerToPoint(2,playerid,255.1123,77.4241,1003.6406) || PlayerToPoint(2,playerid,229.8059,164.7830,1003.0234)
|| PlayerToPoint(2,playerid,-1521.1884,462.9987,7.1875) || PlayerToPoint(2,playerid,712.7550,-554.5677,-3.5950) || PlayerToPoint(2,playerid,-1588.4751,732.4855,-4.9063))
{
if(OnDuty[playerid]==0)
{
SetPVarInt(playerid, "Skin_O", GetPlayerSkin(playerid));
new rand = random(sizeof (SkinsPoliciaDP));
SetPlayerSkin(playerid, SkinsPoliciaDP[rand]);
format(string, sizeof(string), "Oficial %s esta Fardado.", sendername);
SendClientMessageToAll(COLOR_DBLUE,string);
format(string, sizeof(string), "* O Policial %s Pegou seus equipamentos", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
//SetPlayerAttachedObject(playerid,3,18637,13,0.35,0.0,0.0,0.0,0.0,180.0);
VidaDoCara[playerid] = 2; AXITERCOLETE[playerid] = 3;
GivePlayerWeaponBPH(playerid, 24, 150);
GivePlayerWeaponBPH(playerid, 25, 250);
SetPlayerArmour(playerid, 100);
SetPlayerHealth(playerid, 100);
OnDuty[playerid] = 1;
EmpregoDuty[playerid] = 2;
Copsronda += 1;
}
else if(OnDuty[playerid]==1)
{
SetPlayerSkin(playerid, GetPVarInt(playerid, "Skin_O"));
DeletePVar(playerid, "Skin_O");
format(string, sizeof(string), "Oficial %s esta de Folga.", sendername);
SendClientMessageToAll(COLOR_DBLUE,string);
format(string, sizeof(string), "* O Policial %s guardou seus equipamentos", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
//RemovePlayerAttachedObject(playerid,3);
OnDuty[playerid] = 0;
EmpregoDuty[playerid] = 0;
Copsronda -= 1;
ResetPlayerWeapons(playerid);
}
}
}
}
return true;
}
Quando meto a segunda vez /batercartao reseta as armas todas mas o problema й se tiver armas antes de ir /batercartao a 1 vez quando for a desiquipar vai ser tudo resetado!! Preciso de ajuda!!!