SA-MP Forums Archive
help with this please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help with this please (/showthread.php?tid=212220)



help with this please - StyleR - 16.01.2011

Hello guys,i just tryed and i cant get how to make the /enter command to work by pressing F or ENTER ... so if any1 know or wanna help me please post ! i wannna F and ENTER or + buttons ... TY


Re: help with this please - hanzen - 16.01.2011

Put this underneath OnPlayerKeyStateChange()
pawn Код:
if(newkeys & KEY_SECONDARY_ATTACK)
{
// Your code
}



Re: help with this please - StyleR - 16.01.2011

ty but what i type on Your code and how i put the + button ?


Re: help with this please - hanzen - 16.01.2011

This code will run whenever you press enter or F. But whatever you have in `/enter` under that.


Re: help with this please - StyleR - 16.01.2011

is giving me errors

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_JUMP)
{
"/enter"
}

error 030: compound statement not closed at the end of file (started at line 51246)

help plz?


Re: help with this please - BlackWolf120 - 16.01.2011

lol u cant just write /enter
U have to write ur code there.
E.g. a SetPlayerPos(); command for teleporting a player into another interior.

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_JUMP)
{
SetPlayerPos(playerid,x,y,z);
SetPlayerInterior(playerid,YOUR_ID_HERE);
SendClientMessage(playerid,COLOUR,"You've been teleported into a building using the JumpKey");
}
return 1;
}
Just put the code u have in the /enter command into this function


Re: help with this please - StyleR - 16.01.2011

man i wanna do for the SPACE key the /vehctrl menu from Yoshi's script i must make the /vehctrl instead coords !


Re: help with this please - BlackWolf120 - 16.01.2011

this code i gave u is just an example!
Just look up the name of the Button u wanna use in the wiki and paste the code that is used under OnPlayerCommandText for /vehctrl (in ur script) into the code ive posted.
Still im not 100% sure what u want


Re: help with this please - StyleR - 16.01.2011

this i want tnx a lot 10x tnx


Re: help with this please - StyleR - 16.01.2011

errors

C:\Documents and Settings\Admin\Desktop\aa\pawno\include\streamer.i nc(393) : warning 201: redefinition of constant/macro (symbol "OnPlayerEnterRaceCheckpoint")
C:\Documents and Settings\Admin\Desktop\aa\gamemodes\larp.pwn(51248 ) : error 076: syntax error in the expression, or invalid function call
C:\Documents and Settings\Admin\Desktop\aa\gamemodes\larp.pwn(51248 ) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\aa\gamemodes\larp.pwn(51249 -- 51250) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Desktop\aa\gamemodes\larp.pwn(51250 ) : error 001: expected token: "do", but found "return"
C:\Documents and Settings\Admin\Desktop\aa\gamemodes\larp.pwn(51253 ) : error 030: compound statement not closed at the end of file (started at line 51246)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.



public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_JUMP)
{
OnPlayerCommandText for /vehctrl
}
return 1;
}