/go commands wrong interior -
kbalor - 05.09.2012
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?
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;
}
Re: /go commands wrong interior -
romas3110 - 05.09.2012
i made new code for you just try it.
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);
SetPlayerInterior(playerid, GetPlayerInterior(ID));
SetPlayerVirtualWorld(playerid, GetPlayerVirutalWorld(ID));
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;
}
Re: /go commands wrong interior -
leonardo1434 - 05.09.2012
this one...
pawn Код:
CMD:go(playerid, params[])
{
new Float:x, Float:y, Float:z,str[64],ID;
if(sscanf(params,"u",ID)) return 0;
GetPlayerPos(ID, x, y, z);
if(IsPlayerInAnyVehicle(playerid))
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(ID));
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(ID));
SetVehiclePos(GetPlayerVehicleID(playerid), x + 1, y + 1, z);
}
else
{
SetPlayerInterior(playerid, GetPlayerInterior(ID));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(ID));
SetPlayerPos(playerid, x + 1, y + 1, z);
}
format(str, sizeof(str), "{FFFF00}(/go) %s (%d) has teleported to you", getname(playerid), playerid);
SendClientMessage(ID, 0xFFFFFFFF, str);
return 1;
}
stock getname(p)
{
static name[24];
GetPlayerName(p,name,sizeof name);
return name;
}