05.09.2012, 10:18
So here's the problem.
Let's say PlayerID 1 is outside an Interior (0). And my Interior is 3. If I do /go 1. Basically I moved to PlayerID 1 place but my interior is still in Interior 3 and I could only see Dark Gray area (it means that I'm still inside an interior) What's the problem in the go script below?
EDIT: And additional If im inside a vehicle and im in Interior 0 or No interior. Then PlayerID 1 is inside an interior. After I do /go 1, the vehicle also with me. How do the vehicle destroy after teleporting to a Person that is in a interior?
Let's say PlayerID 1 is outside an Interior (0). And my Interior is 3. If I do /go 1. Basically I moved to PlayerID 1 place but my interior is still in Interior 3 and I could only see Dark Gray area (it means that I'm still inside an interior) What's the problem in the go script below?
EDIT: And additional If im inside a vehicle and im in Interior 0 or No interior. Then PlayerID 1 is inside an interior. After I do /go 1, the vehicle also with me. How do the vehicle destroy after teleporting to a Person that is in a interior?
pawn Код:
CMD:go(playerid, params[])
{
new Float:x, Float:y, Float:z, name[MAX_PLAYER_NAME], str[64], i, vw; floats, strings and values
GetPlayerPos(ID, x, y, z);
i = GetPlayerInterior(ID);
vw = GetPlayerVirtualWorld(ID);
if(i) SetPlayerInterior(playerid, i);
if(vw) SetPlayerVirtualWorld(playerid, vw);
if(IsPlayerInAnyVehicle(playerid))
{
if(i)
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid), i);
DestroyVehicle(GetPlayerVehicleID(playerid));
}
if(vw) SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), vw);
SetVehiclePos(GetPlayerVehicleID(playerid), x + 1, y + 1, z);
}
else SetPlayerPos(playerid, x + 1, y + 1, z);
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(str, sizeof(str), "{FFFF00}(/go) %s (%d) has teleported to you", name, playerid);
SendClientMessage(ID, 0xFFFFFFFF, str);
return 1;
}