OnPlayerKeyState
#1

Hi, i have a problem with my system,

Код:
	if (newkeys == KEY_YES)
	{
	for(new i = 0; i < sizeof(RecupInfo); i++)
	{
		if (IsPlayerInRangeOfPoint(playerid, 2.0,RecupInfo[i][RecupArmePosX],RecupInfo[i][RecupArmePosY],RecupInfo[i][RecupArmePosZ]))
		{
			if(GetPlayerVirtualWorld(playerid) == RecupInfo[i][RecupArmeVWorld] && GetPlayerInterior(playerid) == RecupInfo[i][RecupArmeVWorld])
			{
   				GetPlayerName(playerid, sendername, sizeof(sendername));
         		DestroyDynamicObject(DropObject[i]);
          		RecupInfo[i][RecupArmePosX] = 0.0;
		    	RecupInfo[i][RecupArmePosY] = 0.0;
		    	RecupInfo[i][RecupArmePosZ] = 0.0;
				RecupInfo[i][RecupArmeAmmount][0] = 0;
				RecupInfo[i][RecupArmeAmmount][1] = 0;
				GivePlayerWeapon(playerid,RecupInfo[i][RecupArmeAmmount][0],RecupInfo[i][RecupArmeAmmount][1]);
				format(string, sizeof(string), "* %s a ramasser des armes.", sendername);
				SendLocalMessage(playerid, string, 10.0, COLOR_ACTION, COLOR_ACTION);
		    	return 1;
			}
		}
	}
with a command, it works, but in a key, it will not fetch arms
Reply
#2

Change

PHP код:
if (newkeys == KEY_YES
To

PHP код:
if((newkeys KEY_YES)) 
Reply
#3

Quote:
Originally Posted by oMa37
Посмотреть сообщение
Change

PHP код:
if (newkeys == KEY_YES
To

PHP код:
if((newkeys KEY_YES)) 
its the same.

EDIT: mistake is here
PHP код:
&& GetPlayerInterior(playerid) == RecupInfo[i][RecupArmeVWorld
change it to
pawn Код:
&& GetPlayerInterior(playerid) == RecupInfo[i][RecupArmeVWorld]
change the vworld into int or interior, as you have in your script.
Reply
#4

I think you have not understood.
the buttons work, it is the action that needs to touch that does not work.
he must retrieve the weapons with touche KEY_YES.
the sendlocalmessage work, but it will not fetch arms

ALiScripter, yes, it's the same thing.

oMa37, if u use, if (newkeys == KEY_YES) or if((newkeys & KEY_YES)) the function is the same
Reply
#5

You set them to 0 and then calling the function when it should be the opposite.
pawn Код:
GivePlayerWeapon(playerid,RecupInfo[i][RecupArmeAmmount][0],RecupInfo[i][RecupArmeAmmount][1]);

RecupInfo[i][RecupArmeAmmount][0] = 0;
RecupInfo[i][RecupArmeAmmount][1] = 0;
Reply
#6

oh sh!t, thank you +1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)