SA-MP Forums Archive
4 Little Questions - 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: 4 Little Questions (/showthread.php?tid=108766)



4 Little Questions - DeltaAirlines12 - 15.11.2009

1. Is there a FS that saves all the stuff for player class selection that looks like this:

Код:
		  SetPlayerInterior(playerid,0);
		  SetPlayerPos(playerid,-228.306442,2729.432861,62.687500);
	    SetPlayerFacingAngle(playerid, 270.0);
	    SetPlayerCameraPos(playerid,-226.306442,2729.432861,62.687500);
	    SetPlayerCameraLookAt(playerid,-228.306442,2729.432861,62.687500);
2. If not, anyone have that information, only looking at the vinewood sign?

3. How would I make it say "Welcome Dustin, (IP: 192.168.0.1)."
On under on player connect.

4. And onplayerdeath, how would I make the player spawn at the hospital after hes dead?

xD, Yes, I have searched and sorry if it seems like I am spamming.


Re: 4 Little Questions - dirkblok - 15.11.2009

Quote:
Originally Posted by DeltaAirlines12
1. Is there a FS that saves all the stuff for player class selection that looks like this:

Код:
		  SetPlayerInterior(playerid,0);
		  SetPlayerPos(playerid,-228.306442,2729.432861,62.687500);
	    SetPlayerFacingAngle(playerid, 270.0);
	    SetPlayerCameraPos(playerid,-226.306442,2729.432861,62.687500);
	    SetPlayerCameraLookAt(playerid,-228.306442,2729.432861,62.687500);
2. If not, anyone have that information, only looking at the vinewood sign?

3. How would I make it say "Welcome Dustin, (IP: 192.168.0.1)."
On under on player connect.

4. And onplayerdeath, how would I make the player spawn at the hospital after hes dead?

xD, Yes, I have searched and sorry if it seems like I am spamming.
1. try to make it using dini
2. don't know what you mean.
3. Look in the wiki : https://sampwiki.blast.hk/wiki/OnPlayerConnect, and edit it to your wishes
4. below OnPlayerDeath, setplayerpos(playerid, x, y, z); to the positions you want.

And no, it's not spamming, you could try to search better before asking, but this forum is for things like that

No problem at all


Re: 4 Little Questions - Peter_Corneile - 15.11.2009

1. How would we know ? We are supposed to search in the FS ?

2. I didnt understand

3. https://sampwiki.blast.hk/wiki/GetPlayerIp

4. Add this

pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
SetPlayerPos(playerid,X,Y,Z); //coords of the hospital
return 1;
}



Re: 4 Little Questions - LarzI - 15.11.2009

4. add a global variable called pHasDied[MAX_PLAYERS] or something like that.
then under OnPlayerDeath put
pawn Код:
pHasDied[playerid] = 1;
and under OnPlayerSpawn put
pawn Код:
if(pHasDied[playerid] == 1)
{
  SetPlayerPos(...);
  //You do the rest
  pHasDied[playerid] = 0;
}
You should also set the variable in connect and disconnect:
pawn Код:
public OnPlayerConnect(playerid)
{
  pHasDied[playerid] = 0;
  return true;
}
public OnPlayerDisconnect(playerid)
{
  pHasDied[playerid] = 0;
  return true;
}



Re: 4 Little Questions - killer98p - 15.11.2009

Question 2:
Код:
SetPlayerPos(playerid,X,Y,Z); (Players Possition)
SetPlayerCameraPos(playerid,X,Y,Z);(Camera witch will look on player)
SetPlayerCameraLookAt(playerid,X,Y,Z);
Question 4:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
       SendClientMessage(playerid,color,"Your medical bill will comes to 100$");
       GivePlayerMoney(playerid,-100);
       SetPlayerPos(playerid,X,Y,Z);
	return 1;
}
This is For RP Script

But this one is
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
       SetPlayerPos(playerid,X,Y,Z);
       return 1;
}
This one is for normal script




Re: 4 Little Questions - DeltaAirlines12 - 16.11.2009

THANK YOU ALL FOR YOUR REPLY'S!


Re: 4 Little Questions - killer98p - 16.11.2009

No problem !!!