EnsurePlayerSpawn(playerid,x,y,z);
#1

I keep getting...

Код:
C:\Users\ASUS\Desktop\gta.sa\GTA San Andreas\samp\gamemodes\Ensure.pwn(34) : warning 213: tag mismatch
C:\Users\ASUS\Desktop\gta.sa\GTA San Andreas\samp\gamemodes\Ensure.pwn(34 -- 44) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
I'm making a thing that gets a players position 1.5 seconds after he is set somewhere. If it is below the required z coordinate then he keeps getting reset to the required z coord. This is so if objects don't load he will keep respawning until they load. Here is wut I have...

Код:
//top
new Float:x2,y2,z2,angle2;
forward MINZCHECK(playerid);

stock EnsurePlayerSpawn(playerid,Float:x,Float:y,Float:z,Float:angle)
{
    SetPlayerPos(playerid,x,y,z);
    SetplayerFacingAngle(playerid,angle);
    SetTimer("MINZCHECK", 1500, 1);
    Float:x == x2
	  Float:y == y2
	  Float:z == z2
	  Float:angle == angle2;
    
}

public MINZCHECK(playerid)
{
	new Float:tempx,tempy,tempz;
	GetPlayerPos(playerid,tempx,tempy,tempz);
	if(tempz<z2)
	{
	  SetPlayerPos(playerid,x2,y2,z2);
		return 1;
	}
	else if(tempz>=z2)
	{
		KillTimer(MINZCHECK(playerid));
	}
	return 1;
}
Reply
#2

pawn Код:
new
   Float:x2,
   Float:y2,
   Float:z2,
   Float:angle2;
Try that. And yes, you do have to do this long shit, lol.
Reply
#3

Still get the same error
Reply
#4

You can actually freeze players for 1-2 seconds when they are teleported to the place, where your custom objects are.
Top of the script:
pawn Код:
forward ToggleControl(playerid);
Where you need to freeze:
pawn Код:
TogglePlayerControllable(playerid,0);
SetTimerEx("ToggleControl", 1500, 0, "i", playerid);
Somewhere:
pawn Код:
public ToggleControl(playerid)
{
  TogglePlayerControllable(playerid,1);
}
Reply
#5

I'm aware BUT sometimes objects don't laod fast enough for some players this is why I made this. So any help?
Reply
#6

pawn Код:
//top
new Float:x2,y2,z2,angle2;
forward MINZCHECK(playerid);

stock EnsurePlayerSpawn(playerid,Float:x,Float:y,Float:z,Float:angle)
{
    SetPlayerPos(playerid,x2,y2,z2);
    SetplayerFacingAngle(playerid,angle2);
    SetTimer("MINZCHECK", 1500, 1);  
}

public MINZCHECK(playerid)
{
    new Float:tempx,tempy,tempz;
    GetPlayerPos(playerid,tempx,tempy,tempz);
    if(tempz<z2)
    {
      SetPlayerPos(playerid,x2,y2,z2);
        return 1;
    }
    else if(tempz>=z2)
    {
        KillTimer(MINZCHECK(playerid));
    }
    return 1;
}
Reply
#7

Small info about Crack's post. This are the value types defined in it:

Код:
Floats:  x2, x, y, z, angle, tempx, tempy, tempz
Integer: y2, z2, angle2
If you wanted to assign y2, z2 and angle2 a float-number, it would give you a "tag mismatch". Thats like placing an apple onto a orange. Doesn't really fit together.
Reply
#8

Sorry, my mistake:
pawn Код:
//top
new Float:x2,Float:y2,Float:z2,Float:angle2;
forward MINZCHECK(playerid);

stock EnsurePlayerSpawn(playerid,Float:x,Float:y,Float:z,Float:angle)
{
    SetPlayerPos(playerid,x2,y2,z2);
    SetPlayerFacingAngle(playerid,angle2);
    SetTimer("MINZCHECK", 1500, 1);  
}

public MINZCHECK(playerid)
{
new Float:tempx,tempy,tempz;
GetPlayerPos(playerid,tempx,tempy,tempz);
if(tempz<z2)
{
  SetPlayerPos(playerid,x2,y2,z2);
return 1;
}
else if(tempz>=z2)
{
KillTimer(MINZCHECK(playerid));
}
return 1;
}
Reply
#9

And it's SetPlayerFacingAngle not SetplayerFacingAngle.
Reply
#10

Quote:
Originally Posted by $ЂЯĢ
And it's SetPlayerFactionAngle not SetplayerFacingAngle.
Uhm what? Its SetPlayerFacingAngle... you should of background checked that one.

EDIT: Have a look here: SetPlayerFacingAngle
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)