Posts: 1,534
Threads: 179
Joined: Apr 2009
I remember i saw something like this,
you can use CallRemoteFunction for /enter and /exit so people can enter buildings by pressing the enter key
can someone give me the code? +rep
Posts: 1,534
Threads: 179
Joined: Apr 2009
Alright i got that what i wanted, but it doesn't work, it compiles but doesn't work in-game, whats wrong?
pawn Код:
if(newkeys & 16)
{
CallLocalFunction("OnPlayerCommandText", "is", playerid, "/enter");
CallLocalFunction("OnPlayerCommandText", "is", playerid, "/exit");
}
Posts: 1,534
Threads: 179
Joined: Apr 2009
Nah, it doesn't show the message, also doesn't work if i add return 1;
Posts: 186
Threads: 2
Joined: Aug 2011
Reputation:
0
Funny.. I have this same method to enter buildings, but I don't make it CallLocalFunction. I do it how I showed you on my first post. Why not just do it with SetPlayerPos, and SetPlayerInterior...
Posts: 1,765
Threads: 1
Joined: Aug 2011
Reputation:
0
Umm, If the test isnt called the Key your searchin for is wrong OR there is somthing wrong with the code above that. Please post any code that comes before the calling of this key.
Posts: 1,534
Threads: 179
Joined: Apr 2009
pawn Код:
new newcar = GetPlayerVehicleID(playerid);
if(newkeys & KEY_SPRINT)
{
if(gPlayerUsingLoopingAnim[playerid] == 1)
{
gPlayerUsingLoopingAnim[playerid] = 0;
ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
animation[playerid] = 0;
TextDrawHideForPlayer(playerid,txtAnimHelper);
}
}
if(IsAnOwnableCar(newcar))
{
if(PlayerInfo[playerid][pPcarkey] == newcar) { }
else if(PlayerInfo[playerid][pPcarkey2] == newcar) { }
else if(PlayerInfo[playerid][pPcarkey3] == newcar) { }
else { return 1; }
}
This is everything under OnPlayerKeyStateChange, i added the CallLocalFunction at the first place