01.11.2014, 15:33
Hi, I've been trying to make a command which is to become invisible to other players while the caster can see all the players
problem is, after i've typed it, my screen says 'stay within the world boundaries', and starts to fuck up my screen by CONSTANTLY BRIGHTEN it, and it became laggy
PHP код:
public OnPlayerUpdate(playerid)
{
if(Invisible[playerid] == 1) return 0;
return 1;
}
forward OnVanish(playerid, posx, posy, posz, angle);
public OnVanish(playerid, posx, posy, posz, angle) {
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, posx, posy, posz);
SetPlayerFacingAngle(playerid, angle);
return 1;
}
CMD:vanish(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] < 4) return 0;
if(Invisible[playerid] == 0) {
new Float:pPosX, Float:pPosY, Float:pPosZ, Float:Angle;
GetPlayerPos(playerid, pPosX, pPosY, pPosZ);
GetPlayerFacingAngle(playerid, Angle);
SetPlayerVirtualWorld(playerid, 3);
Invisible[playerid] = 1;
SetTimerEx("OnVanish", 100, false, "iffff", playerid, pPosX, pPosY, pPosZ, Angle);
SendMessage(playerid, ">> You are now invisible!");
} else {
new Float:pPosX, Float:pPosY, Float:pPosZ;
GetPlayerPos(playerid, pPosX, pPosY, pPosZ);
SetPlayerPos(playerid, pPosX, pPosY, pPosZ + 5);
Invisible[playerid] = 0;
SendMessage(playerid, ">> You are now visible to other players!");
}
return 1;
}