use a key to open something.
#1

hi,
can someone help me i dont know how to make that you can use a key to open something not use like /open
i want to use a key ?
is that possible ?
and how then.
Reply
#2

no one ??
please i want with like 2 open a door or something ?
Reply
#3

It depends.

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Reply
#4

and do i need a .inc file ??
it say undifined symbol ? at newkeys
or i need to add it to new list ?

and i got now like this:

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


  		if(IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 6)
	    {
	        if(IsPlayerInRangeOfPoint(playerid, 1,245.22988891602, 72.328125, 1004.1201782227) || IsPlayerInRangeOfPoint(playerid,1, 245.2560,74.1671,1003.6406))
			{
			      PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
		      		MoveObject(pddoor11, 242.92161560059, 72.452613830566, 1002.640625, 3.0);
		      		MoveObject(pddoor12, 249.89422607422, 72.452613830566, 1002.640625, 3.0);
		      		SendClientMessage(playerid, COLOR_BLUE,"LSPD door is opened and will close in 2 seconds!");
		      		GetPlayerName(playerid, sendername, sizeof(sendername));
		      		format(string, sizeof(string), "* %s opens the LSPD door.", sendername);
		      		ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
		      		SetTimer("pddoorclose", 2000, 0);
				}
		}
		return 1;
	}
i got again this errors -.- ....
Код:
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(3628) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(3657) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(3891) : error 004: function "SafeSetPlayerInterior" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(5793) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(5833) : error 004: function "SafeResetPlayerWeapons" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(5852) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(5891) : error 004: function "SaveGuns" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(5895) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(5899) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(5903) : error 004: function "UpdatePlayerPosition" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6009) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6010) : error 004: function "SafeSetPlayerInterior" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6019) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6020) : error 004: function "SafeSetPlayerInterior" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6052) : error 004: function "RemoveRoadblock" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6125) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6131) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6146) : error 004: function "SafeResetPlayerWeapons" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6147) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6148) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6149) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6150) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6151) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6152) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6153) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(6154) : error 004: function "SafeGivePlayerWeapon" is not implemented

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Reply
#5

check je accolades
of kij of je ergens een gewoon haakje bent vergeten

oops sorry not the dutch board..
couldnt bother me to rewrite it on ma phonee..
Reply
#6

You forgot a bracket somewhere "}"
Reply
#7

or u just use the MoveObject Thing , i hope thats useful , and btw its not easy to make it , so give it a shot with the MoveObject
Reply
#8

You could use IsPlayerInRangeOfPoint/PlayerToPoint, its easier.
Reply
#9

lol it was already maked but only what is key to make it 2 ?
thanks for help all
Reply
#10

Quote:
Originally Posted by Dennis_Sanchez
Посмотреть сообщение
lol it was already maked but only what is key to make it 2 ?


and with another one i get these errors:
Код:
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(76265) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(76267) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(76268) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(76269) : warning 219: local variable "pveh" shadows a variable at a preceding level
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(76270) : warning 219: local variable "newcar" shadows a variable at a preceding level
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(76271) : warning 219: local variable "gun1" shadows a variable at a preceding level
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(76272) : warning 219: local variable "gunname1" shadows a variable at a preceding level
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(76270) : warning 204: symbol is assigned a value that is never used: "newcar"
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(76269) : warning 204: symbol is assigned a value that is never used: "pveh"
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(76353) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(76353) : warning 215: expression has no effect
C:\Documents and Settings\Eigenaar\Mijn documenten\XOK Roleplaye by iRana\gamemodes\xokrp.pwn(76353) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Okay, show us your code now... You're basically doing (for example) "new bla;" for things which have already been defined. Then your doing (for example) "new bla;" but not even using the variable you just made.
Reply
#11

thanks for help got it now

but what is key for 2 is that ACTION ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)