26.02.2012, 11:23
I have very strange error with this:
In case of group 5, when player is at the range co-ordinates, it doesn't detect that player is there and sends else (Olete vдravast liiga kaugel). Co-ordinates are correct, tested several times. Anyone has any ideas, what's wrong? Everything else works.
pawn Код:
CMD:v2rav(playerid, params[]) {
if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1) {
if(IsPlayerInRangeOfPoint(playerid, 20.0, 2238.20, 2450.44, 10.69)) switch(LVPDGates[0][1]) {
case 0: {
MoveDynamicObject(LVPDGates[0][0],2238.20, 2450.44, 10.69, 1.2, -90.00, 0.00, 0.00);
LVPDGates[0][1] = 1;
}
case 1: {
MoveDynamicObject(LVPDGates[0][0],2238.20, 2450.44, 10.69, 1.2, -11.0000, 0.0000, 0.0000);
LVPDGates[0][1] = 0;
}
}
else if(IsPlayerInRangeOfPoint(playerid, 20.0, 2335.07, 2443.71, 6.60)) switch (LVPDGates[1][1]) {
case 0: {
MoveDynamicObject(LVPDGates[1][0],2335.0742, 2443.7065, 11.0753, 1.2);
LVPDGates[1][1] = 1;
PlayerPlaySoundEx(1035, 1589.19995117,-1637.98498535,14.69999981);
}
case 1: {
MoveDynamicObject(LVPDGates[1][0],2335.07, 2443.71, 6.60, 1.2);
LVPDGates[1][1] = 0;
PlayerPlaySoundEx(1035, 1589.19995117,-1637.98498535,14.69999981);
}
}
else {
SendClientMessage(playerid,-1,"Olete vдravast liiga kaugel.");
}
}
else if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 5) {
if(IsPlayerInRangeOfPoint(playerid, 20.0, 1690.2139, 988.3061, 10.8203)) switch(LVAKGates[0][1]) {
case 0: {
MoveDynamicObject(LVAKGates[0][0],1702.6167, 985.7719, 12.6557, 1.2);
LVAKGates[0][1] = 1;
PlayerPlaySoundEx(1035, 1589.19995117,-1637.98498535,14.69999981);
}
case 1: {
MoveDynamicObject(LVAKGates[0][0],1691.70, 989.19, 12.66, 1.2);
LVAKGates[0][1] = 0;
PlayerPlaySoundEx(1035, 1589.19995117,-1637.98498535,14.69999981);
}
}
else {
SendClientMessage(playerid,-1,"Olete vдravast liiga kaugel.");
}
}
else {
SendClientMessage(playerid,-1,"Teil pole pulti.");
}
return 1;
}