SA-MP Forums Archive
Need help... agin - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help... agin (/showthread.php?tid=64921)



Need help... agin - pumpkin - 08.02.2009

Код:
	if (strcmp(cmdtext, "/enterjailshop", true)==0)
	{
	if(PlayerToPoint(1, playerid, 679.1613,-1797.6292,12.4691,342.7083))
	{
	SetPlayerInterior(playerid,10);
	SetPlayerPos(playerid,366.923980,360.0641,384.3123,-72.929359,-79.3703,-54.7400,1001.507812,1000.5078,1006.5078,315.000);
	return SendClientMessage(playerid,0xFFFFFFAA,"You have entered Jail Burger shot!");
	}
	return 1;
	}

	if(strcmp(cmdtext,"/exitjailshop",true)==0)
	{
	if(PlayerToPoint(1.0,playerid,679.1613,-1797.6292,12.4691,342.7083))
	{
	SetPlayerInterior(playerid,0);
	SetPlayerPos(playerid,679.1613,-1797.6292,12.4691,342.7083);
	return SendClientMessage(playerid,0xFFFFFFAA,"You have left Jail Burger shot!");
	}
	return 1;
	}
}

PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
	new Float:oldposx, Float:oldposy, Float:oldposz;
	new Float:tempposx, Float:tempposy, Float:tempposz;
	GetPlayerPos(playerid, oldposx, oldposy, oldposz);
	tempposx = (oldposx -x);
	tempposy = (oldposy -y);
	tempposz = (oldposz -z);
	if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
	{
		return 1;
	}
	return 0;
}
When i start serv then it crashes.... any ideas?


Re: Need help... agin - [WS]Hyper - 08.02.2009

Well I know it has nothing to do with those..
But I do see after the /exitjailshop command you have
pawn Код:
return 1;
    }
}
it should be
pawn Код:
return 1;
    }
    return 0;
}
And you should read that identation topic.. cause you have none.


Re: Need help... agin - pumpkin - 08.02.2009

Lol i did what you typed.

Now i will get the message /login password

and then crash.

Before i had : Connection with server =Crash


Btw.... what you mean with identation topic ?


Re: Need help... agin - [WS]Hyper - 08.02.2009

There was some topic, I think Andre made it about identation but I can't find it anymore :S .

Anyways, identation means that you don't put everything in one line (virtical).
So not

hello
{
hello
}

but

hello
{
hello
}

Anyways, you will have to upload your OnPlayerConnect callback to pastebin or here if it's small.. otherwise we cant solve ur problem.


Re: Need help... agin - Auto-Sized - 08.02.2009

I hope you changed the code from above mate. Its wrong in many ways.


Re: Need help... agin - pumpkin - 09.02.2009

Quote:
Originally Posted by ♦۞pкћп§-шŧųĄ۞♦
I hope you changed the code from above mate. Its wrong in many ways.
Damn... I am Pawn Beginner.... i dont understand a sh*t..... i want make Burger shot near verona beach(so i need :addstaticpickup

and /enter /exit .....

Could someone give me something ?? i just change cords... it should fix


Re: Need help... agin - Auto-Sized - 09.02.2009

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if (strcmp(cmdtext, "/enter", true)==0)//Just use enter/exit for commands as PlayerToPoint will know where you are.
    {
    if(PlayerToPoint(1, playerid, 679.1613, -1797.6292, 12.4691))//Enter Point change to where you want Burgershot. (1)
      {
        SetPlayerPos(playerid, 375.962463, -65.816848, 1001.507812);//Spawn inside BurgerShot interior.(2)
        SetPlayerInterior(playerid, 10);
        SendClientMessage(playerid, 0xFFFFFFAA, "You have entered Burgershot!");
        return 1;
      }
    }

  if(strcmp(cmdtext,"/exit",true)==0)
    {
    if(PlayerToPoint(1.0,playerid, 375.962463, -65.816848, 1001.507812))//Inside BurgerShot Exit Point(2).
      {
        SetPlayerPos(playerid, 679.1613, -1797.6292, 12.4691);//OutSide BurgerShot(1).
        SetPlayerInterior(playerid,0);
        SendClientMessage(playerid,0xFFFFFFAA,"You have left Burgershot!");
        return 1;
      }
    }
  return 0;
}