can not spawn in place that has been specified
#1

I am confused, maybe the people here can help me
I've done debugging, code I've loaded correctly
but when I enter the code, my character did not spawn correctly

make my server takes a lot of ram
Код:
enum mapinfos
{
	mapid = 1,
	NamaMap[64],
	HumanX[24],
	HumanY[24],
	HumanZ[24],
	ZombieX[24],
	ZombieY[24],
	ZombieZ[24]
};
new MapInfo[mapinfos];

public OnPlayerSpawn(playerid)
{
	if(GetPlayerTeam(playerid) == ZOMBIE)
    {
    	SetPlayerInterior(playerid, MapInfo[Interior]);
		SetPlayerPos(playerid, MapInfo[HumanX], MapInfo[HumanY], MapInfo[HumanZ]); // tag mismatch 194
    }
    else
    {
	    SetPlayerInterior(playerid, MapInfo[Interior]);
		SetPlayerPos(playerid, MapInfo[ZombieX], MapInfo[ZombieY], MapInfo[ZombieZ]); // tag mismatch 194
    }
	return 1;
}
Reply
#2

Try to make the HumanX, Y, Z and ZombieX, Y, Z floats instead since you seem to want them to be used as floats in SetPlayerPos. Not sure why you made them arrays

To make a variable a float in pawn, put "Float:" in front of the variable name, example:
Код:
new Float:myvar;
Reply
#3

A position or so called coordinate is in the form of floats, what you have defined them as is as strings. Difference by these two is that floats are decimal such as:
1.00005
and a string is text.. such as:
"Hello world!"
If you look at ****** maps and enter a coord, you'll notice it'll show as a float. Here's a fixed code:
PHP код:
enum mapinfos
{
    
mapid 1,
    
NamaMap[64],
    
Float:HumanX,
    
Float:HumanY,
    
Float:HumanZ,
    
Float:ZombieX,
    
Float:ZombieY,
    
Float:ZombieZ
}; 
Reply
#4

thanks man its working,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)