Fixing something
#1

Hi there

Iґd like to try a filterscript from Pixels out. Unfortunately its not working with SA:MP 0.3. Why?
Код:
public OnPlayerConnect(playerid)
{
	for(new o=0; o<60; o++) CreatePlayerObject(playerid,354,0,0,0,0,0,0);
	Spawned[playerid] = 0;
	return 1;
}

public OnPlayerSpawn(playerid)
{
	Spawned[playerid] = 1;
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	Spawned[playerid] = 0;
	return 1;
}

public SnowTimer()
{
	for(new i=0; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i) && Spawned[i] == 1)
	{
	  SetWorldTime(24);
	 	new Float:Pos[3],Float:pObjectPos[3];
	  GetPlayerPos(i,Pos[0],Pos[1],Pos[2]);
	  for(new b=0; b<60; b++)
	  {
	    if(b < 20) SetPlayerObjectPos(i,b,Pos[0]+random(40)-4,Pos[1],Pos[2]+30);
			if(b < 40 && b > 20) SetPlayerObjectPos(i,b,Pos[0]-random(30)+3,Pos[1],Pos[2]+30);
			if(b < 50 && b > 40) SetPlayerObjectPos(i,b,Pos[0],Pos[1]+random(37)-2,Pos[2]+30);
			if(b > 50) SetPlayerObjectPos(i,b,Pos[0],Pos[1]-random(39)+2,Pos[2]+30);
			GetPlayerObjectPos(i,b,pObjectPos[0],pObjectPos[1],pObjectPos[2]);
	    MovePlayerObject(i,b,pObjectPos[0],pObjectPos[1],Pos[2],5);
	  }
  	}
	return 1;
}
Reply
#2

It hasn't worked since before 0.3.
Reply
#3

You tell the code to create 60 player objects when the player connects. Well idk why you would want to do that but you're creating them at the player as soon as he connects. So maybe he doesn't have a proper x, y, z?
Reply
#4

Its not my code, Iґve copied it from Pixelґs snow FS. And it worked with SA:MP 0.2 too.
Reply
#5

Oh, I didn't scroll down. Now I see. Maybe try moving the create objects part and the loop to when the player spawns? You would need to do something to keep it from happening every time though.
Reply
#6

It works now. But another question. Why is this FS not working? (Yes im sure it doesnt work)

http://forum.sa-mp.com/index.php?topic=82530.0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)