Quote:
Originally Posted by Shadoww5
PHP код:
if(strcmp(cmdtext, "/enter", true) == 0)
{
if(GetPlayerWantedLevel(playerid) < 1 && IsPlayerInRangeOfPoint(playerid, 5.0,999.2678,-919.9958,42.1797))
{
SetPlayerPos(playerid,-27.312299,-29.277599,1003.557250);
SetPlayerInterior(playerid,4);
PlayerInfo[playerid][pInt] = 4;
GameTextForPlayer(playerid, "~h~24/7", 5000, 1);
}
else { GameTextForPlayer(playerid, "~r~Criminals can't hide in here!", 5000, 1); }
return 1;
}
|
Yes, but i don't want this command,i change my mind. I want for houses and business. Thats why i put this code here
Код:
if(strcmp(cmd, "/enter", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
{
//printf("Found House :%d",i);
if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
{
if(GetPlayerWantedLevel(playerid) < 1)
{
SetPlayerInterior(playerid,HouseInfo[i][hInt]);
SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
PlayerInfo[playerid][pLocal] = i;
}
else
{
GameTextForPlayer(playerid, "~r~Criminals can't hide in houses!", 5000, 1);
return 1;
}
}
else
{
GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
return 1;
}
}
}
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
//printf("Found House :%d",i);
if(!IsACop(playerid) && i == 3)
{
SendClientMessage(playerid, COLOR_GREY, " Cops only !");
return 1;
}
if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerCash(playerid) >= BizzInfo[i][bEntranceCost])
{
if(GetPlayerWantedLevel(playerid) < 1)
{
if(PlayerInfo[playerid][pPbiskey] != i)
{
if(BizzInfo[i][bLocked] == 1)
{
GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
return 1;
}
if(BizzInfo[i][bProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
return 1;
}
GivePlayerCash(playerid,-BizzInfo[i][bEntranceCost]);
format(string, sizeof(string), "~r~-$%d~n~~w~type /exit~n~to get out", BizzInfo[i][bEntranceCost]);
BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
ExtortionBiz(i, BizzInfo[i][bEntranceCost]);
BizzInfo[i][bProducts]--;
OnPropUpdate();
GameTextForPlayer(playerid, string, 5000, 3);
}
SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
PlayerInfo[playerid][pLocal] = i+99;
new dood[MAX_PLAYER_NAME];
GetPlayerName(playerid, dood, sizeof(dood));
format(string, sizeof(string), "%s payed $%d to enter biz %d", dood, BizzInfo[i][bEntranceCost], i);
printf("%s", string);
PayLog(string);
//PlayerInfo[playerid][pLocal] = i;
}
else
{
GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
}
}
else
{
GameTextForPlayer(playerid, "~r~Criminals can't hide in houses!", 5000, 1);
return 1;
}
}
}
I've tried to make it works but don't work ...