if(strcmp(cmd, "/enter", true) == 0)
{
if(PlayerTied[playerid] != 0 || PlayerCuffed[playerid] != 0 || PlayerJustDied[playerid] != 0) return SendClientMessage(playerid, COLOR_GRAD1, " You are unable to do that at this time.");
for(new i = 0;i < sizeof(EntranceRef);i++)
{
if(
IsPlayerInRangeOfPoint(playerid,2,Entrances[i][outside_x],Entrances[i][outside_y],Entrances[i][outside_z]) &&
GetPlayerVirtualWorld(playerid) == Entrances[i][outside_w] &&
GetPlayerInterior(playerid) == Entrances[i][outside_i])
{
if(strlen(Entrances[i][dpassword])) // has a pass
{
ShowPlayerDialog( playerid,
DIALOG_ID_PLAYER_PASS,
DIALOG_STYLE_INPUT,
"Door Password",
"Please enter the door's password to enter.",
"Okay",
"Cancel");
return 1;
}
if(Entrances[i][dfaction] == 0)
{
SetPlayerPos(playerid,Entrances[i][inside_x],Entrances[i][inside_y],Entrances[i][inside_z]);
SetPlayerFacingAngle(playerid,Entrances[i][inside_a]);
SetPlayerInterior(playerid,Entrances[i][inside_i]);
SetPlayerVirtualWorld(playerid,Entrances[i][inside_w]);
SetCameraBehindPlayer(playerid);
if(Entrances[i][freeze])
{
FreezePlayer(playerid, FREEZE, ENTER_FREEZE);
}
}
#define PRESSING(%0,%1) \
(%0 & (%1))
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
if(PRESSED(KEY_YES))
{
if(PlayerTied[playerid] != 0 || PlayerCuffed[playerid] != 0 || PlayerJustDied[playerid] != 0) return SendClientMessage(playerid, COLOR_GRAD1, " You are unable to do that at this time.");
for(new i = 0;i < sizeof(EntranceRef);i++)
{
if(
IsPlayerInRangeOfPoint(playerid,2,Entrances[i][outside_x],Entrances[i][outside_y],Entrances[i][outside_z]) &&
GetPlayerVirtualWorld(playerid) == Entrances[i][outside_w] &&
GetPlayerInterior(playerid) == Entrances[i][outside_i])
{
if(strlen(Entrances[i][dpassword])) // has a pass
{
ShowPlayerDialog( playerid,
DIALOG_ID_PLAYER_PASS,
DIALOG_STYLE_INPUT,
"Door Password",
"Please enter the door's password to enter.",
"Okay",
"Cancel");
return 1;
}
if(Entrances[i][dfaction] == 0)
{
SetPlayerPos(playerid,Entrances[i][inside_x],Entrances[i][inside_y],Entrances[i][inside_z]);
SetPlayerFacingAngle(playerid,Entrances[i][inside_a]);
SetPlayerInterior(playerid,Entrances[i][inside_i]);
SetPlayerVirtualWorld(playerid,Entrances[i][inside_w]);
SetCameraBehindPlayer(playerid);
if(Entrances[i][freeze])
{
FreezePlayer(playerid, FREEZE, ENTER_FREEZE);
}
}
}
}
}
|
Put this at your #defines section
PHP код:
PHP код:
|
ShowEnter(playerid)
{
if(PlayerTied[playerid] != 0 || PlayerCuffed[playerid] != 0 || PlayerJustDied[playerid] != 0) return SendClientMessage(playerid, COLOR_GRAD1, " You are unable to do that at this time.");
for(new i = 0;i < sizeof(EntranceRef);i++)
{
if(
IsPlayerInRangeOfPoint(playerid,2,Entrances[i][outside_x],Entrances[i][outside_y],Entrances[i][outside_z]) &&
GetPlayerVirtualWorld(playerid) == Entrances[i][outside_w] &&
GetPlayerInterior(playerid) == Entrances[i][outside_i])
{
if(strlen(Entrances[i][dpassword])) // has a pass
{
ShowPlayerDialog( playerid,
DIALOG_ID_PLAYER_PASS,
DIALOG_STYLE_INPUT,
"Door Password",
"Please enter the door's password to enter.",
"Okay",
"Cancel");
return 1;
}
if(Entrances[i][dfaction] == 0)
{
SetPlayerPos(playerid,Entrances[i][inside_x],Entrances[i][inside_y],Entrances[i][inside_z]);
SetPlayerFacingAngle(playerid,Entrances[i][inside_a]);
SetPlayerInterior(playerid,Entrances[i][inside_i]);
SetPlayerVirtualWorld(playerid,Entrances[i][inside_w]);
SetCameraBehindPlayer(playerid);
if(Entrances[i][freeze])
{
FreezePlayer(playerid, FREEZE, ENTER_FREEZE);
}
}
}
}
}
|
Put this at your #defines section
PHP код:
PHP код:
|
: warning 219: local variable "string" shadows a variable at a preceding level
#define PRESSING(%0,%1) \
(%0 & (%1))
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
|
Remove this:
PHP код:
|
|
im laughing badly sadly
you didn't take his notes, you wrote that in OnPlayercommandtext or W/e that bs is if you look at what he actually said and not just copy + c and copy +v, he said put it under OnPlayerKeyStateChange |