[Ajuda] Atalho
#1

Serб que alguйm me consegue arranjar umas linhas de script, para por o meu comando /entrar, que serve para entrar em insides ( houses, business, buildings ) para tambйm dar para entrar no SPACE do teclado ?
Reply
#2

Sim da.

E so vocк colocar a KEY_HANDBRAKE Eu acho .
Reply
#3

Pois, eu tinha feito KEY_SPACE
Mas como й a linha de script, sendo que o comando /entrar й o seguinte:

Quote:

if(strcmp(cmd, "/entrar", true) == 0)
{
for(new i = 0; i < sizeof(Houses); i++)
{
if(IsPlayerInRangeOfPoint(playerid,1.0,Houses[i][EnterX],Houses[i][EnterY],Houses[i][EnterZ]))
{
if(GetPlayerVirtualWorld(playerid) == Houses[i][EnterWorld])
{
if(PlayerInfo[playerid][pHouseKey] == i || Houses[i][Locked] == 0 || PlayerInfo[playerid][pAdmin] >= 1)
{
SetPlayerInterior(playerid,Houses[i][ExitInterior]);
SetPlayerPos(playerid,Houses[i][ExitX],Houses[i][ExitY],Houses[i][ExitZ]);
SetPlayerVirtualWorld(playerid,i);
SetPlayerFacingAngle(playerid,Houses[i][ExitAngle]);
}
else
{
GameTextForPlayer(playerid, "~r~Trancado", 5000, 1);
}
}
}
}

Reply
#4

Coloca em OnPlayerKeyStateChange.
pawn Код:
if(newkeys & KEY_HANDBRAKE)
{
for(new i = 0; i < sizeof(Houses); i++)
{
if(IsPlayerInRangeOfPoint(playerid,1.0,Houses[i][EnterX],Houses[i][EnterY],Houses[i][EnterZ]))
{
if(GetPlayerVirtualWorld(playerid) == Houses[i][EnterWorld])
{
if(PlayerInfo[playerid][pHouseKey] == i || Houses[i][Locked] == 0 || PlayerInfo[playerid][pAdmin] >= 1)
{
SetPlayerInterior(playerid,Houses[i][ExitInterior]);
SetPlayerPos(playerid,Houses[i][ExitX],Houses[i][ExitY],Houses[i][ExitZ]);
SetPlayerVirtualWorld(playerid,i);
SetPlayerFacingAngle(playerid,Houses[i][ExitAngle]);
}
else
{
GameTextForPlayer(playerid, "~r~Trancado", 5000, 1);
}
}
}
}
Reply
#5

Obrigado
Reply
#6

Mas pera nгo funcionou, como й que hei-de pфr ?

Onde meto o OnPlayerKeyStateChange ?
Reply
#7

OnPlayerKeyStateChange e uma public.

Meta Ctrl + F, e coloque OnPlayerKeyStateChange que vocк vai achar.
Reply
#8

Meto assim:

Quote:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_HANDBRAKE)
{
for(new i = 0; i < sizeof(Houses); i++)
{
if(IsPlayerInRangeOfPoint(playerid,1.0,Houses[i][EnterX],Houses[i][EnterY],Houses[i][EnterZ]))
{
if(GetPlayerVirtualWorld(playerid) == Houses[i][EnterWorld])
{
if(PlayerInfo[playerid][pHouseKey] == i || Houses[i][Locked] == 0 || PlayerInfo[playerid][pAdmin] >= 1)
{
SetPlayerInterior(playerid,Houses[i][ExitInterior]);
SetPlayerPos(playerid,Houses[i][ExitX],Houses[i][ExitY],Houses[i][ExitZ]);
SetPlayerVirtualWorld(playerid,i);
SetPlayerFacingAngle(playerid,Houses[i][ExitAngle]);
}
else
{
GameTextForPlayer(playerid, "~r~Trancado", 5000, 1);
}
}
}
}

?
Reply
#9

Sim.

The message you have entered is too short. Please lengthen your message to at least 8 characters.
Reply
#10

Deu-me 3 erros:

error 029: invalid expression, assumed zero
error 017: undefined symbol "newkeys"
error 017: undefined symbol "newkeys"

E eu meti da seguinte maneira:

Quote:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_HANDBRAKE)
{
for(new i = 0; i < sizeof(Houses); i++)
{
if(IsPlayerInRangeOfPoint(playerid,1.0,Houses[i][EnterX],Houses[i][EnterY],Houses[i][EnterZ]))
{
if(GetPlayerVirtualWorld(playerid) == Houses[i][EnterWorld])
{
if(PlayerInfo[playerid][pHouseKey] == i || Houses[i][Locked] == 0 || PlayerInfo[playerid][pAdmin] >= 1)
{
SetPlayerInterior(playerid,Houses[i][ExitInterior]);
SetPlayerPos(playerid,Houses[i][ExitX],Houses[i][ExitY],Houses[i][ExitZ]);
SetPlayerVirtualWorld(playerid,i);
SetPlayerFacingAngle(playerid,Houses[i][ExitAngle]);
}
}
else
{
GameTextForPlayer(playerid, "~r~Trancado", 5000, 1);
}
}
}
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)