04.09.2011, 08:11
Err, I think you only explained how to add entrances in the .cfg file.
Double loops
Rating how do you explain : 2.5/10
Nice code though.
Double loops
pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
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]
)
{
GameTextForPlayer(playerid, "~w~Type ~r~/door~w~ to go inside", 5000, 5);
return 1;
}
}
for(new i = 0;i < sizeof(EntranceRef);i++)
{
if(
IsPlayerInRangeOfPoint(playerid,2,Entrances[i][inside_x],Entrances[i][inside_y],Entrances[i][inside_z])
&&
GetPlayerVirtualWorld(playerid) == Entrances[i][inside_w]
)
{
GameTextForPlayer(playerid, "~w~Type ~r~/door~w~ to go outside", 5000, 5);
return 1;
}
}
return 1;
}
Nice code though.