15.04.2013, 15:03
Seguinte, quando digito /ir, ou /trazer dentro de algum interior, o player buga, fica caindo no meio do nada, ou fika tudo preto, teria algum modo de desbugar isso? como?
pawn Код:
if(strcmp(cmd, "/ir", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /ir [id]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo, world;
plo = ReturnUser(tmp);
world = GetPlayerVirtualWorld(plo);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
if(PlayerInfo[plo][pAdmin] >= 1342 && PlayerInfo[playerid][pAdmin] < 1342)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode ir atй um Admin Dono !");
return 1;
}
if(Spectate[playerid] != 255)
{
Spectate[playerid] = 256;
}
GetPlayerPos(plo, plocx, plocy, plocz);
if(PlayerInfo[plo][pInt] > 0)
{
SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];
PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
}
if(PlayerInfo[plo][pInt] == 0)
{
SetPlayerInterior(playerid,0);
}
if(plocz > 530.0 && PlayerInfo[plo][pInt] == 0) //the highest land point in sa = 526.8
{
SetPlayerInterior(playerid,1);
PlayerInfo[playerid][pInt] = 1;
}
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz); LinkVehicleToInterior(tmpcar, 0);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
SetPlayerVirtualWorld(playerid, world);
SendClientMessage(playerid, 0x33FF00FF, "Vocк foi teleportado pelo Admin !");
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
GetPlayerName(plo, plname, MAX_PLAYER_NAME);
if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
{}
else { format(string, sizeof(string), "O Admin %s Foi Atй %s.",playername,plname); }
ProxDetector(30.0, playerid, string, 0x33FF00FF,0x33FF00FF,0x33FF00FF,0x33FF00FF,0x33FF00FF);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a usar este comando!");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Esse nгo й um player ativo.");
}
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/trazer", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /trazer [id]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo, world;
plo = ReturnUser(tmp);
world = GetPlayerVirtualWorld(playerid);
if(PlayerInfo[plo][pJailed] != 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode trazer um Preso");
return 1;
}
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
if(PlayerInfo[plo][pAdmin] >= 1342 && PlayerInfo[playerid][pAdmin] < 1342)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode trazer um Admin Dono !");
return 1;
}
GetPlayerPos(playerid, plocx, plocy, plocz);
if(PlayerInfo[playerid][pInt] > 0)
{
SetPlayerInterior(plo,PlayerInfo[playerid][pInt]);
PlayerInfo[plo][pInt] = PlayerInfo[playerid][pInt];
PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];
}
if(PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(plo,0);
}
if(plocz > 930.0 && PlayerInfo[playerid][pInt] == 0) //the highest land point in sa = 526.8
{
SetPlayerInterior(plo,1);
PlayerInfo[plo][pInt] = 1;
}
if (GetPlayerState(plo) == 2)
{
TelePos[plo][0] = 0.0;
TelePos[plo][1] = 0.0;
new tmpcar = GetPlayerVehicleID(plo);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz); LinkVehicleToInterior(tmpcar, 0);
SetVehicleVirtualWorld(tmpcar,world);
}
else
{
SetPlayerPos(plo,plocx,plocy+2, plocz);
}
SetPlayerVirtualWorld(plo,world);
SendClientMessage(plo, 0x33FF00FF, "Vocк foi teleportado pelo Admin !");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando!");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Esse nгo й um jogador ativo.");
}
}
return 1;
}