18.12.2009, 11:33
I made a /enter and /exit command for Darrens housing system because I couldn't find the original, but they keep leading to ID 0, For Example: ID 0 house invites you, you get there and type /enter and it works same with /exit. However, ID 1 house invites you, you get there and type /enter but it doesn't work. Same with the /exit with the /breakin command, everytime I type /exit and it isn't in ID 0's house it won't work.
ENTER
EXIT
And this is what's wrong with /find, everytime I find someone and they aren't ID 0 their name won't go back to the Team Color, here's the code for that:
ENTER
Код:
if(InvitedToHouse[playerid] == 1)
{
if(IsPlayerConnected(playerid))
{
new Float:housex = PlayerInfo[giveplayerid][pHouseX];
new Float:housey = PlayerInfo[giveplayerid][pHouseY];
new Float:housez = PlayerInfo[giveplayerid][pHouseZ];
new Float:houseintx = PlayerInfo[giveplayerid][pHouseIntX];
new Float:houseinty = PlayerInfo[giveplayerid][pHouseIntY];
new Float:houseintz = PlayerInfo[giveplayerid][pHouseIntZ];
new housevw = PlayerInfo[giveplayerid][pHouseVW];
new houseint = PlayerInfo[giveplayerid][pHouseInt];
new Float:px, Float:py, Float:pz;
GetPlayerPos(playerid,px,py,pz);
if(PlayerToPoint(3.0,playerid,housex,housey,housez))
{
SetPlayerPos(playerid,houseintx,houseinty,houseintz);
SetPlayerVirtualWorld(playerid,housevw);
SetPlayerInterior(playerid,houseint);
return 1;
}
}
}
Код:
if(InvitedToHouse[playerid] == 1)
{
if(IsPlayerConnected(playerid))
{
new Float:housex = PlayerInfo[giveplayerid][pHouseX];
new Float:housey = PlayerInfo[giveplayerid][pHouseY];
new Float:housez = PlayerInfo[giveplayerid][pHouseZ];
new Float:houseintx = PlayerInfo[giveplayerid][pHouseIntX];
new Float:houseinty = PlayerInfo[giveplayerid][pHouseIntY];
new Float:houseintz = PlayerInfo[giveplayerid][pHouseIntZ];
new Float:px, Float:py, Float:pz;
GetPlayerPos(playerid,px,py,pz);
if (PlayerToPoint(2.0, playerid,houseintx,houseinty,houseintz))
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,housex,housey,housez);
SetPlayerVirtualWorld(playerid,0);
InvitedToHouse[playerid] = 0;
}
}
}
if(HouseBreakin[playerid] == 1)
{
if(IsPlayerConnected(playerid))
{
new Float:housex = PlayerInfo[giveplayerid][pHouseX];
new Float:housey = PlayerInfo[giveplayerid][pHouseY];
new Float:housez = PlayerInfo[giveplayerid][pHouseZ];
new Float:houseintx = PlayerInfo[giveplayerid][pHouseIntX];
new Float:houseinty = PlayerInfo[giveplayerid][pHouseIntY];
new Float:houseintz = PlayerInfo[giveplayerid][pHouseIntZ];
new Float:px, Float:py, Float:pz;
GetPlayerPos(playerid,px,py,pz);
if (PlayerToPoint(2.0, playerid,houseintx,houseinty,houseintz))
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,housex,housey,housez);
SetPlayerVirtualWorld(playerid,0);
HouseBreakin[playerid] = 0;
}
}
}
Код:
if(FindTime[i] > 0)
{
if(IsPlayerConnected(i))
{
if(FindTime[i] == FindTimePoints[i])
{
giveplayerid = ReturnUser(tmp);
FindTime[i] = 0;
FindTimePoints[i] = 0;
DisablePlayerCheckpoint(i);
PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
GameTextForPlayer(i, "~r~RedMarker gone", 2500, 1);
SetPlayerToTeamColor(giveplayerid);
}
else
{
format(string, sizeof(string), "%d", FindTimePoints[i] - FindTime[i]);
GameTextForPlayer(i, string, 1500, 6);
FindTime[i] += 1;
}
}
}

