#1

Hey People,

Now i have got this:

Код:
new poort;

	MoveObject(poort, 3502.5634765625, -187.08984375, 9.2750568389893, 2.0);

	poort = CreateObject(10828, 3502.5634765625, -187.08984375, 9.2750568389893, 0.0, 0.0, 0.4998779296875);

	if (strcmp("/agateopen", cmdtext, true, 10) == 0)
	{
 		MoveObject(poort, 3502.5634765625, -187.08984375, 3.1000456809998, 2.0);
		SendClientMessage(playerid, 0x00FF00AA, "De poort is nu geopend.");
		SetTimer("GateClose", 9000, false);
		return 1;
	}
Its with a command...
I want that u press the Space balk that the gates opens.. WIthouth command.
How to fix that?
Greetingz Drowzz
Reply
#2

Nederland FTW

Hmm, i guess its something with OnPlayerKeyStateChange
Sorry i cant help you, im not experienced on keys

Cya, and goodluck on ur project.
Reply
#3

You can use isplayerinrange and the gate will open itself
Код:
if (IsPlayerInRange(Range, Float: Z_Range, Float:tar_x, Float:tar_y, Float:tar_z)
Reply
#4

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SPRINT)
    {
        MoveObject(poort, 3502.5634765625, -187.08984375, 3.1000456809998, 2.0);
        SendClientMessage(playerid, 0x00FF00AA, "De poort is nu geopend.");
        SetTimer("GateClose", 9000, false);
        return 1;
    }
    return 1;
}
Reply
#5

Mademan made it but, wouldnt it be better if you also use isplayerinrange
Then show a GameModeText and then allow key_sprint coz else you can open the gate when u start sprinting -.-
Reply
#6

Can u make an example for me with is player in arrange?
Reply
#7

Quote:
Originally Posted by Drowzz
Can u make an example for me with is player in arrange?
You mean like this?
pawn Код:
IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z);
Reply
#8

Yes, I dont understand what is must fill in...? :S
Reply
#9

Quote:
Originally Posted by Drowzz
Yes, I dont understand what is must fill in...? :S
Код:
(playerid, Float:range, Float:x, Float:y, Float:z)
playerid	     The ID of the player you want to check the point range of.
Float:range	The furthest distance the player can be to be in range.
Float:x	     The X coordinate of the point to check the range to.
Float:y	     The Y coordinate of the point to check the range to.
Float:z	     The Z coordinate of the point to check the range to.
Reply
#10

A good read:
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange

List of key values:
https://sampwiki.blast.hk/wiki/GetPlayerKeys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)