18.11.2013, 07:07
pawn Код:
command(enter, playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 2269.3821,-75.3405,26.7724))
{
SetPlayerPos(playerid, 916.6719,2380.9543,246.4695);
SetPlayerInterior(playerid, 1);
GameTextForPlayer(playerid, "~g~T66bьroo~n~~r~Tryki /v2lju et v2ljuda hoonest", 3000, 5);
LoadInterior(playerid);
FadePlayerScreen(playerid, BLACK, 15);
}
if(IsPlayerInRangeOfPoint(playerid, 5.0, 248.19241, -33.15711, 1.60261))
{
SetPlayerPos(playerid, -2029.7589,-118.3868,1035.1719);
SetPlayerInterior(playerid, 3);
GameTextForPlayer(playerid, "~w~ARK~n~~r~Tryki /v2lju et v2ljuda hoonest", 3000, 5);
LoadInterior(playerid);
FadePlayerScreen(playerid, BLACK, 5);
}
else if(IsPlayerInRangeOfPoint(playerid, 5.0, 627.9313,-571.6613,17.4696))
{
SetPlayerPos(playerid, 246.2813,108.7695,1003.2188);
SetPlayerInterior(playerid, 10);
GameTextForPlayer(playerid, "~w~Red County Sheriff's Department~n~~r~Tryki /v2lju et v2ljuda hoonest", 3000, 5);
LoadInterior(playerid);
FadePlayerScreen(playerid, BLACK, 5);
}
else if(IsPlayerInRangeOfPoint(playerid, 5.0, 624.0983,-600.0155,16.7198))
{
if(Player[playerid][Faction] == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), 1589.5502,-1646.0876,11.3940);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 201.7274);
LoadInterior(playerid);
FadePlayerScreen(playerid, BLACK, 5);
}
else
{
SetPlayerPos(playerid, 1589.5502,-1646.0876,11.3940);
LoadInterior(playerid);
FadePlayerScreen(playerid, BLACK, 5);
}
}
else return SendClientMessage(playerid, WHITE, "Sul pole хigust siia siseneda.");
}
else
{
for(new i = 1; i < MAX_HOUSES; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, Houses[i][HouseExteriorX], Houses[i][HouseExteriorY], Houses[i][HouseExteriorZ]))
{
if(Houses[i][HouseLocked] == 0)
{
new string[256];
SetPlayerPos(playerid, Houses[i][HouseInteriorX], Houses[i][HouseInteriorY], Houses[i][HouseInteriorZ]);
SetPlayerInterior(playerid, Houses[i][HouseInteriorID]);
format(string, sizeof(string), "~w~%s~n~~r~Trьki /v2lju et vдljuda hoones", Houses[i][HouseName]);
GameTextForPlayer(playerid, string, 3000, 5);
SetPlayerVirtualWorld(playerid, Houses[i][HouseWorld]);
LoadInterior(playerid);
FadePlayerScreen(playerid, BLACK, 5);
}
else
{
new string[256];
format(string, sizeof(string), "%s on hetkel suletud.", Houses[i][HouseName]);
SendClientMessage(playerid, WHITE, string);
}
}
}
for(new i = 1; i < MAX_BUSINESS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, Business[i][BusinessExteriorX], Business[i][BusinessExteriorY], Business[i][BusinessExteriorZ]))
{
if(Business[i][BusinessEnterable] == 1)
{
if(Player[playerid][Money] >= Business[i][BusinessEnterFee])
{
new string[256];
SetPlayerPos(playerid, Business[i][BusinessInteriorX], Business[i][BusinessInteriorY], Business[i][BusinessInteriorZ]);
SetPlayerInterior(playerid, Business[i][BusinessInteriorID]);
format(string, sizeof(string), "Teretulemast %s. Omanik %s. Sissepддsu tasu: $%d.", Business[i][BusinessName], Business[i][BusinessOwner], Business[i][BusinessEnterFee]);
SendClientMessage(playerid, WHITE, string);
InBusiness[playerid] = i;
Player[playerid][Money] -= Business[i][BusinessEnterFee];
SetPlayerVirtualWorld(playerid, Business[i][BusinessWorld]);
format(string, sizeof(string), "~w~%s~n~~r~Trьki /v2lju et vдljuda hoones", Business[i][BusinessName]);
GameTextForPlayer(playerid, string, 3000, 5);
LoadInterior(playerid);
FadePlayerScreen(playerid, BLACK, 5);
}
else return SendClientMessage(playerid, GREY, "Sul pole piisavalt raha, et siia siseneda.");
}
else return SendClientMessage(playerid, WHITE, "Siia firmasse ei saa hetkel siseneda.");
}
}
}
return 1;
}
pawn Код:
if(newkeys == KEY_NO)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
if(newkeys == KEY_NO)
{
command_enter;
return 1;
}
}
}