10.06.2010, 07:16
Or is just me?
I have this in a FS:
no matter if I put 0.0, 0.1, 0.5, this trigger is always TRUE.
What the fuck?
* x, y, and z coordinates are taken from npcid, wich is an npc executing the timer that contains this loop.
Here's the header if you like:
I just gave you the start of the timer, where the variables are taken from, and the condition. There are other checks before that, but they don't mess with this part. Every check is independent.
I have this in a FS:
no matter if I put 0.0, 0.1, 0.5, this trigger is always TRUE.
What the fuck?
* x, y, and z coordinates are taken from npcid, wich is an npc executing the timer that contains this loop.
Код:
if(IsPlayerInRangeOfPoint(i, 0.5, x,y,z)) // HERE { if(IsPlayerAimingAtPlayer(i, npcid)) { switch(weapon) { case 0,14: NPC_Chat[npcid][life] -= 7; case 1: NPC_Chat[npcid][life] -= 8; case 2,3,5,6,7,15: NPC_Chat[npcid][life] -= 10; case 4,8: NPC_Chat[npcid][life] -= 14; case 22,23,24,25,26,27,28,29,30,31,32,33: NPC_Chat[npcid][life] -= 2; case 34: continue; } ApplyAnimation(npcid,"ped","HIT_front",4.1,0,0,0,0,0); NPC_Chat[npcid][insultedby] = i; // You anger the bastard!!! //SendClientMessage(i, COLOR_RED, "DAMAGE 1.0"); } }
Код:
forward Check(npcid); public Check(npcid) { new Float:x,Float:y,Float:z,name[30]; GetPlayerPos(npcid, x,y,z); GetPlayerName(npcid, name, sizeof(name)); for(new i=0;i<MAX_PLAYERS;i++) { if(i != npcid && IsPlayerConnected(i) && ( !IsPlayerNPC(i) || (IsPlayerNPC(i) && IsPlayerInAnyVehicle(i)))) { if(((HOLDING(KEY_HANDBRAKE) && (PRESSED(KEY_FIRE) || PRESSED(KEY_SECONDARY_ATTACK)) || PRESSED(KEY_FIRE))) && PlayerKeys[i][1] != 300 && !IsPlayerInAnyVehicle(i) && GetPlayerState(i) == 1) { if(IsPlayerInRangeOfPoint(i, 0.5, x,y,z)) // THIS IS THE PART { if(IsPlayerAimingAtPlayer(i, npcid)) { switch(weapon) { case 0,14: NPC_Chat[npcid][life] -= 7; case 1: NPC_Chat[npcid][life] -= 8; case 2,3,5,6,7,15: NPC_Chat[npcid][life] -= 10; case 4,8: NPC_Chat[npcid][life] -= 14; case 22,23,24,25,26,27,28,29,30,31,32,33: NPC_Chat[npcid][life] -= 2; case 34: continue; } ApplyAnimation(npcid,"ped","HIT_front",4.1,0,0,0,0,0); NPC_Chat[npcid][insultedby] = i; // You anger the bastard!!! //SendClientMessage(i, COLOR_RED, "DAMAGE 1.0"); } } } } }