RC5 and RC6 Bug with InRange
#1

I use likes old GF CrimInRange, but if any ppl are in a vehicle that dosn't work.

I have NPC Cops and if you have more then 2 Wanteds u get +1 Wanted from this Cop.
But with RC5 and RC6 thats don't work. If you leave the vehicle then u get the Wanted.

The same if a player gives via Bodyguard a ppl into a car Armor. The script don't notice this and the player is banned after he leave the vehicle...

Код:
Armor[playerid] = 1; SetPlayerArmour(playerid, 200);
SetTimerEx("ArmorCheck", 60000, 0, "i", playerid);
Reply
#2

What? there is a language called English, use it.
Reply
#3

and which part you don't understand?
Reply
#4

Quote:
Originally Posted by DVDK
Посмотреть сообщение
What? there is a language called English, use it.
maybe you have better english skill man.
Forget English skills, just try help.
Now come with mimimimim.

No comments...
Reply
#5

He has npc that just walks / drives around the map. If a player with wanted level gets near the npc he gets +1 wanted level. in these new versions its not working.
The other problem is with armour giving - the player gets banned if a bodyguard gives him armour while player is in a car.

piohh, please post your npc and armour check code for us to help.
Reply
#6

Its a Bug with onplayerupdate.

onplayerupdate ignor this if a player is into a vehicle.
I add another timer and then all works fine.

Код:
		if(WantedLevel[playerid]>=2 && PlayerCuffed[playerid]==0 && PlayerTied[playerid]==0 && PlayerInfo[playerid][pCrimInRangeWanted]==0)
		{
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
				    if(IsPlayerNPC(i) && PlayerInfo[i][pMember]==1 && CrimInRange(30.0, playerid,i))
					{
						WantedPoints[playerid]+=2;
						SetPlayerCriminal(playerid,255, "Suspect is near a NPC Cop in Los Santos");
						PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
						PlayerInfo[playerid][pCrimInRangeWanted] = 1;
						SetTimerEx("CrimInRangeWanted", 284850, 0, "i", playerid);
						return 1;
					}
				    if(IsPlayerNPC(i) && PlayerInfo[i][pMember]==15 && CrimInRange(30.0, playerid,i))
					{
						WantedPoints[playerid]+=2;
						SetPlayerCriminal(playerid,255, "Suspect is near a NPC Cop in San Fierro");
						PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
						PlayerInfo[playerid][pCrimInRangeWanted] = 1;
						SetTimerEx("CrimInRangeWanted", 284850, 0, "i", playerid);
						return 1;
					}
				    if(IsPlayerNPC(i) && PlayerInfo[i][pMember]==23 && CrimInRange(30.0, playerid,i))
					{
						WantedPoints[playerid]+=2;
						SetPlayerCriminal(playerid,255, "Suspect is near a NPC Cop in Las Venturas");
						PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
						PlayerInfo[playerid][pCrimInRangeWanted] = 1;
						SetTimerEx("CrimInRangeWanted", 284850, 0, "i", playerid);
						return 1;
					}
				}
			}
		}
First pic I'm sitting in the car and nothing...


I get out the car and... oO works...
Reply
#7

Quote:
Originally Posted by piohh
Посмотреть сообщение
and which part you don't understand?
This part:

Quote:
Originally Posted by piohh
Посмотреть сообщение
The same if a player gives via Bodyguard a ppl into a car Armor
Ontopic:
Like Kye said before, it's not good to put mutch code into OnPlayerUpdate, this get's called about 20 times a second for each player.
EDIT: It's even whorse, you use a loop of MAX_PLAYERS (500) in OnPlayerUpdate + a lot of code? lolumad?
Reply
#8

Yeah OUCH at that loop. Even with Foreach that would be yikes. Anyway, What is CrimInRange?
Reply
#9

Quote:
Originally Posted by MisterTickle
Посмотреть сообщение
Yeah OUCH at that loop. Even with Foreach that would be yikes. Anyway, What is CrimInRange?
It's the same likes ProxDetector

No I don't use so mutch codes in onplayerupdate.
Reply
#10

Can we see the code?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)