else if(newkeys == KEY_SECONDARY_ATTACK)//NON FUNZIONA!!!
{
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3)
{
if (PlayerToPointStripped(5, playerid,245.0578,72.4314,1002.5406,cx,cy,cz))
{
if (portacentrale == 1)
{
portacentrale = 0;
MoveDynamicObject(lspddoor1, 244.0578,72.4314,1002.5406, 3.5000);
MoveDynamicObject(lspddoor2, 247.1478,72.4314,1002.5406, 3.5000);
SendClientMessage(playerid, COLOR_BLUE,"La porta и aperta, chiudila per favore!");
format(string, sizeof(string), "* %s apre la porta della centrale.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
MoveDynamicObject(lspddoor1, 245.0578,72.4314,1002.5406, 3.5000);
MoveDynamicObject(lspddoor2, 245.9478,72.4314,1002.5406, 3.5000);
SendClientMessage(playerid, COLOR_BLUE,"Porta della centrale chiusa!");
format(string, sizeof(string), "* %s chiude la porta della centrale.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
portacentrale = 1;
}
}
}
}
else if(newkeys == KEY_SECONDARY_ATTACK)//NON FUNZIONA!!!
{
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3)
{
if (PlayerToPointStripped(5, playerid,245.0578,72.4314,1002.5406,cx,cy,cz))
{
if (portacentrale == 1)
{
portacentrale = 0;
MoveDynamicObject(lspddoor1, 244.0578,72.4314,1002.5406, 3.5000);
MoveDynamicObject(lspddoor2, 247.1478,72.4314,1002.5406, 3.5000);
SendClientMessage(playerid, COLOR_BLUE,"La porta и aperta, chiudila per favore!");
format(string, sizeof(string), "* %s apre la porta della centrale.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
MoveDynamicObject(lspddoor1, 245.0578,72.4314,1002.5406, 3.5000);
MoveDynamicObject(lspddoor2, 245.9478,72.4314,1002.5406, 3.5000);
SendClientMessage(playerid, COLOR_BLUE,"Porta della centrale chiusa!");
format(string, sizeof(string), "* %s chiude la porta della centrale.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
portacentrale = 1;
}
}
return 1;
You didnt return eny value of the KEY try this
pawn Код:
|
else if(newkeys == KEY_SECONDARY_ATTACK)//NON FUNZIONA!!!
{
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3)
{
if (PlayerToPointStripped(5, playerid,245.0578,72.4314,1002.5406,cx,cy,cz))
{
if (portacentrale == 1)
{
portacentrale = 0;
MoveDynamicObject(lspddoor1, 244.0578,72.4314,1002.5406, 3.5000);
MoveDynamicObject(lspddoor2, 247.1478,72.4314,1002.5406, 3.5000);
SendClientMessage(playerid, COLOR_BLUE,"La porta и aperta, chiudila per favore!");
format(string, sizeof(string), "* %s apre la porta della centrale.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
MoveDynamicObject(lspddoor1, 245.0578,72.4314,1002.5406, 3.5000);
MoveDynamicObject(lspddoor2, 245.9478,72.4314,1002.5406, 3.5000);
SendClientMessage(playerid, COLOR_BLUE,"Porta della centrale chiusa!");
format(string, sizeof(string), "* %s chiude la porta della centrale.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
portacentrale = 1;
}
}
}
return 1;
}
if ((newkeys & KEY_SECONDARY_ATTACK)//NON FUNZIONA!!! { new Float:cx, Float:cy, Float:cz; GetPlayerPos(playerid, cx, cy, cz); if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3) { if (PlayerToPointStripped(5, playerid,245.0578,72.4314,1002.5406,cx,cy,cz)) { if (portacentrale == 1) { portacentrale = 0; MoveDynamicObject(lspddoor1, 244.0578,72.4314,1002.5406, 3.5000); MoveDynamicObject(lspddoor2, 247.1478,72.4314,1002.5406, 3.5000); SendClientMessage(playerid, COLOR_BLUE,"La porta и aperta, chiudila per favore!"); format(string, sizeof(string), "* %s apre la porta della centrale.", PlayerName(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } else { MoveDynamicObject(lspddoor1, 245.0578,72.4314,1002.5406, 3.5000); MoveDynamicObject(lspddoor2, 245.9478,72.4314,1002.5406, 3.5000); SendClientMessage(playerid, COLOR_BLUE,"Porta della centrale chiusa!"); format(string, sizeof(string), "* %s chiude la porta della centrale.", PlayerName(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); portacentrale = 1; } } } }
Код:
if ((newkeys & KEY_SECONDARY_ATTACK)//NON FUNZIONA!!! { new Float:cx, Float:cy, Float:cz; GetPlayerPos(playerid, cx, cy, cz); if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3) { if (PlayerToPointStripped(5, playerid,245.0578,72.4314,1002.5406,cx,cy,cz)) { if (portacentrale == 1) { portacentrale = 0; MoveDynamicObject(lspddoor1, 244.0578,72.4314,1002.5406, 3.5000); MoveDynamicObject(lspddoor2, 247.1478,72.4314,1002.5406, 3.5000); SendClientMessage(playerid, COLOR_BLUE,"La porta и aperta, chiudila per favore!"); format(string, sizeof(string), "* %s apre la porta della centrale.", PlayerName(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } else { MoveDynamicObject(lspddoor1, 245.0578,72.4314,1002.5406, 3.5000); MoveDynamicObject(lspddoor2, 245.9478,72.4314,1002.5406, 3.5000); SendClientMessage(playerid, COLOR_BLUE,"Porta della centrale chiusa!"); format(string, sizeof(string), "* %s chiude la porta della centrale.", PlayerName(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); portacentrale = 1; } } } } |