06.09.2012, 20:05
Recently I've added GarHouse System in my server (It doesn't allow people to enter someones house Visiting must be enables first)
Problem is that when Player1 is inside his house. Then Player2 try to go to Player1 using the command /go Player1.
it just teleports Player1 right beside Player2. Is it possible disable go if a player is inside a GarHouse?
Let's say if isplayerinhouse Show gametextforplayer "Player is Inside a House"
Problem is that when Player1 is inside his house. Then Player2 try to go to Player1 using the command /go Player1.
it just teleports Player1 right beside Player2. Is it possible disable go if a player is inside a GarHouse?
Let's say if isplayerinhouse Show gametextforplayer "Player is Inside a House"
pawn Код:
CMD:go(playerid, params[])
{
new ID;//creates a new something idk what we call it :P but it is defined later on or used in something this 1 is used in next line
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Usage: /go [PlayerID/PartofName]");//checks if you have written something after /goto if no it sends error
if(!IsPlayerConnected(ID) || ID == playerid) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}This player is Offline or it is Yourself");
if(GetPVarInt(playerid, "Jailed") == 1) return GameTextForPlayer(playerid,"Player is Jailed",2000,3);
if(IsPlayerInDM[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF,"{FFFF00}(/go) {FF0000}command is disabled at this moment");
new Float:x, Float:y, Float:z,str[64],tID;
if(sscanf(params,"u",tID)) return 0;
GetPlayerPos(tID, x, y, z);
if(IsPlayerInAnyVehicle(playerid))
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(tID));
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(tID));
SetVehiclePos(GetPlayerVehicleID(playerid), x + 1, y + 1, z);
}
else
{
SetPlayerInterior(playerid, GetPlayerInterior(tID));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(tID));
SetPlayerPos(playerid, x + 1, y + 1, z + 0.5);
}
format(str, sizeof(str), "{FFFF00}(/go) %s (%d) has teleported to you", getname(playerid), playerid);
SendClientMessage(tID, 0xFFFFFFFF, str);
return 1;
}