help key state
#3

if you want your gates open when you press a key then you have to put your codes under this function

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{


	return 1;
}
il make you a example:

oh and here you can get the button id-s https://sampwiki.blast.hk/wiki/GetPlayerKeys
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{

    if(newkeys & KEY_SPRINT) // Sprint key, when you want you character run faster
   {
if(gate==0)
{
gate = 1;
MoveObject(gatename, 1588.965698, -1637.882690, 7.710285, 1.50);
}
else if(gate==1)
{
gate= 0;
MoveObject(gatename, 1588.965698, -1637.882690, 15.260185, 1.50);
    }

}
	return 1;
}
its pretty easy, just the function needs to be scripted better, it was just given for an example, you have to change to your likings.
Reply


Messages In This Thread
help key state - by [MKD]Max - 08.07.2011, 18:41
Re: help key state - by WoodPecker - 08.07.2011, 18:58
Re: help key state - by andruz99 - 08.07.2011, 20:54
Re: help key state - by Unte99 - 11.07.2011, 18:37

Forum Jump:


Users browsing this thread: 1 Guest(s)