Quote:
Originally Posted by Whoo
OnPlayerPickUpPickup
Pickups IDS
PHP код:
new Hospital[2];
public OnGameModeInit()
{
Hospital[0] = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1); // Aqui vocк coloca as coordenadas para entrar
Hospital[1] = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1); // Aqui vocк coloca as coordenadas de sair
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == Hospital[0]) // Entrar
{
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid, 1177.3695, -1340.4095, 9280.5693);
}
else if(pickupid == Hospital[1]) // Sair
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1172.5526, -1323.2614, 15.4028);
}
return 1;
}
|
po cara, nгo cheguei a testar, mas vou te dar +rep por ter se preocupado em me ajudar!
Quote:
Originally Posted by DiegoLeo
Para colocar a tecla "F" ou a "Enter" para entrar ou sair do hospital basta usar a public OnPlayerKeyStateChange , da seguinte maneira.
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newskeys & KEY_SECONDARY_ATTACK)
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, 1172.5526, -1323.2614, 15.4028))
{
return cmd_entrar(playerid);
}
if(IsPlayerInRangeOfPoint(playerid, 1.0, 1177.3695, -1340.4095, 9280.5693))
{
return cmd_sair(playerid);
}
}
return 1;
}
|
deu certinho cara, obrigadгo, +rep.