PDA

View Full Version : Areas


silverms
22/04/2017, 11:16 AM
hey I have this
else if (areatype[areaid][0] == AREA_TYPE_EPROP)
{
if (IsPlayerInAnyVehicle(playerid) || (GetPlayerVirtualWorld(playerid) != 0 && GetPlayerVirtualWorld(playerid) < 10000)) return 1;
new playername[MAX_PLAYER_NAME], Float:x, Float:y;
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
new string[256], name[MAX_PLAYER_NAME], str[256];
GetPlayerName(playerid, name, sizeof(name));
new temp2;
temp2 = dini_Int(AddDirFile(dir_datafiles, FILE_TOTALSTAT), "maxpropint");
for (new i = 1; i <= temp2; i++)
{
format(string, sizeof(string), "propint%d", i);
format(str, sizeof(str), "prop%d", dini_Int(AddDirFile(dir_propints, string), "propid"));
if(dini_Int(AddDirFile(dir_propints, string), "locked")==1)
{
SendClientMessage(playerid, COLOR_RED, "ERROR:This Property Is Locked.");
return 1;
}
x = adata[adata[areatype[areaid][1]][linkto]][ax] + floatsin(-adata[adata[areatype[areaid][1]][linkto]][aa], degrees) * 2.3;
y = adata[adata[areatype[areaid][1]][linkto]][ay] + floatcos(-adata[adata[areatype[areaid][1]][linkto]][aa], degrees) * 2.3;
SetPlayerVirtualWorld2(playerid, 10000+areaid);
SetPlayerInterior(playerid, adata[adata[areatype[areaid][1]][linkto]][ai]);
SetPlayerPos(playerid, x, y, adata[adata[areatype[areaid][1]][linkto]][az]);
SetPlayerFacingAngle(playerid, adata[adata[areatype[areaid][1]][linkto]][aa]);
SetCameraBehindPlayer(playerid);
plastdoor[playerid] = areatype[areaid][1];
}
}
this is when some one enter a house, but when I lock the house and try to enter it send me that the house is locked but tho it set my pos in the house so how to break and stop every thing if the house was locked?

silverms
22/04/2017, 12:08 PM
bump

silverms
23/04/2017, 09:29 AM
bump

Kane
23/04/2017, 09:31 AM
format(string, sizeof(string), "propint%d", i);
format(str, sizeof(str), "prop%d", dini_Int(AddDirFile(dir_propints, string), "propid"));
if(dini_Int(AddDirFile(dir_propints, string), "locked")==1)
{
SendClientMessage(playerid, COLOR_RED, "ERROR:This Property Is Locked.");
}
else
{
x = adata[adata[areatype[areaid][1]][linkto]][ax] + floatsin(-adata[adata[areatype[areaid][1]][linkto]][aa], degrees) * 2.3;
y = adata[adata[areatype[areaid][1]][linkto]][ay] + floatcos(-adata[adata[areatype[areaid][1]][linkto]][aa], degrees) * 2.3;
SetPlayerVirtualWorld2(playerid, 10000+areaid);
SetPlayerInterior(playerid, adata[adata[areatype[areaid][1]][linkto]][ai]);
SetPlayerPos(playerid, x, y, adata[adata[areatype[areaid][1]][linkto]][az]);
SetPlayerFacingAngle(playerid, adata[adata[areatype[areaid][1]][linkto]][aa]);
SetCameraBehindPlayer(playerid);
plastdoor[playerid] = areatype[areaid][1];
}

?

silverms
23/04/2017, 11:31 AM
still

raydx
23/04/2017, 11:34 AM
It's loop. Use continue; or break; instead of return 1;

silverms
23/04/2017, 12:45 PM
I used break bus stiff

khRamin78
23/04/2017, 01:39 PM
if(dini_Int(AddDirFile(dir_propints, string), "locked")==1)
{
return SendClientMessage(playerid, COLOR_RED, "ERROR:This Property Is Locked.");
}

silverms
23/04/2017, 06:27 PM
didn't work too

JessThompson
24/04/2017, 06:59 AM
Try this for me please,


else if (areatype[areaid][0] == AREA_TYPE_EPROP) {
if (IsPlayerInAnyVehicle(playerid) || (GetPlayerVirtualWorld(playerid) != 0 && GetPlayerVirtualWorld(playerid) < 10000)) return 1;
new playername[MAX_PLAYER_NAME], Float: x, Float: y;
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
new string[256], name[MAX_PLAYER_NAME], str[256];
GetPlayerName(playerid, name, sizeof(name));
new temp2;
temp2 = dini_Int(AddDirFile(dir_datafiles, FILE_TOTALSTAT), "maxpropint");
for (new i = 1; i <= temp2; i++) {
format(string, sizeof(string), "propint%d", i);
format(str, sizeof(str), "prop%d", dini_Int(AddDirFile(dir_propints, string), "propid"));
if (dini_Int(AddDirFile(dir_propints, string), "locked") == 1) {
SendClientMessage(playerid, COLOR_RED, "ERROR:This Property Is Locked.");
}
else
{
x = adata[adata[areatype[areaid][1]][linkto]][ax] + floatsin(-adata[adata[areatype[areaid][1]][linkto]][aa], degrees) * 2.3;
y = adata[adata[areatype[areaid][1]][linkto]][ay] + floatcos(-adata[adata[areatype[areaid][1]][linkto]][aa], degrees) * 2.3;
SetPlayerVirtualWorld2(playerid, 10000 + areaid);
SetPlayerInterior(playerid, adata[adata[areatype[areaid][1]][linkto]][ai]);
SetPlayerPos(playerid, x, y, adata[adata[areatype[areaid][1]][linkto]][az]);
SetPlayerFacingAngle(playerid, adata[adata[areatype[areaid][1]][linkto]][aa]);
SetCameraBehindPlayer(playerid);
plastdoor[playerid] = areatype[areaid][1];
}