How to get position?
#1

Im a noob at scripting and all, i started my server today and im really a noob.And i have a question, also i was surfing around the forum looking for some cool scripts and how to be one.
Anyways here's the question:
1.How to get the position you know those x, y, .... how do you get it? Because i want to make a spawn point.
2. Which script of admin do you suggest?
3. Any other sites of how to become a scripter? And yes i know about some , but i want a theory or something ... basics of scripting.

Thanks and yes im a newbie ...
Reply
#2

1. In game type /save, then exit and look in your GTA directory for "savedpositions.txt". You don't have to install a script for this to work.
2. They're all fairly good, just use the search button, looks at the command lists and read the replies.
3. This and the wiki are the best places to go.

The 3 most important wiki pages IMO for a beginner:

Main Page
Functions List
Tutorials
Reply
#3

Go into any server,stand where you want to to spawn and type t to open chat,then type /save (reminder message like "pimp spawn). Then go to program files/rockstar games/san andreas and look for txt file "saved positions" and the co ordiantes will be there like this:

AddPlayerClass(259,-2684.9246,-366.6084,6.3643,48.3785,0,0,0,0,0,0); // golfer spawn new

green is the skin 259 is a golfer
red is the co-ords of where he will spawn
blue is his spawn weapons 0,0,0,0,0,0 (weaponid,bullets,weaponid,bullets,weaponid,bullet s) exeption being 16,17,18 would be molotov/grenade/teargas and then the number ,so 18,5 would be 5 molotov cocktails
Reply
#4

Thanks both of you, and do you think this script would work ?

Код:
public SetupPlayerForClassSelection(playerid)
{
 	SetPlayerInterior(playerid,0);
	SetPlayerPos(playerid,2247.6599,2401.3601,11.2500);
	SetPlayerFacingAngle(playerid, 90.0);
	SetPlayerCameraPos(playerid,2247.6599,2401.3601,11.2500);
	SetPlayerCameraLookAt(playerid,2247.6599,2401.3601,11.2500);
}
Also Mr_FinnigaN When you said 259 green is a skin .. do you mean a nametag?
And Mr_FinnigaN i read your signature can you please give me the link for that antiteam killing?

And do you think this script would be okay for making a team ?

Код:
//At the top of your script

#define TEAM_FBI 1

new gteam[MAX_PLAYERS];

//Under the heading OnPlayerRequestClass

public OnPlayerRequestClass(playerid, classid)
{

  switch (classid) {
   case 0:
   {
             gteam[playerid] = TEAM_S.W.A.T;
   }
   }
return 1;
}
One more question regarding above script:
-Where do you type it ? i mean when you go to pawno and click new there always comes up something some kind of script.. so what should i do .. i normaly delete that and paste the script i find is that okay? or do i need always to go down and paste it (without deleting the text ... i hope you get my point)

One more question:
How do you make to /register and /login, i know server already has it but i dont like it because i autologin and i dont like that i want to type myself /login ...

Thanks again.
Reply
#5

First off you used #define FBI but then you salled it s.w.at below,you have to #define f.b.i then do "gteam[playerid] = TEAM_F.B.I;"

Second :

Код:
// top of your gamemode
forward SettingPlayerTeam();
//OnPlayerConnect
SetTimerEx("SettingPlayerTeam",10,1,"d",playerid);
//Bottom of your script
public SettingPlayerTeam()
{
  for(new playerid; playerid < 200; playerid++)
    SetPlayerTeam(playerid, gTeam[playerid]);
  return 1;
}
This is a code i got from "Seif" and it works for me where bullets do not hurt teammates.

Third
Код:
public SetupPlayerForClassSelection(playerid)
{
 	SetPlayerInterior(playerid,0);
	SetPlayerPos(playerid,2247.6599,2401.3601,11.2500);
	SetPlayerFacingAngle(playerid, 90.0);
	SetPlayerCameraPos(playerid,2247.6599,2401.3601,11.2500);
	SetPlayerCameraLookAt(playerid,2247.6599,2401.3601,11.2500);
}
For this to work public SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2247.6599,2401.3601,11.2500) ;
SetPlayerFacingAngle(playerid, 90.0);
SetPlayerCameraPos(playerid,2247.6599,2401.3601,11 .2500);
SetPlayerCameraLookAt(playerid,2247.6599,2401.3601 ,11.2500);
}


public SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2247.6599,2401.3601,11.2500) ;
SetPlayerFacingAngle(playerid, 90.0);
SetPlayerCameraPos(playerid,2247.6599,2401.3601,11 .2500);
SetPlayerCameraLookAt(playerid,2247.6599,2401.3601 ,11.2500);
}

for this to work SetPlayerCameraPos has to be differnet so your looking at the spawn not away from it,so save spawn point,take a few steps and turn around thenso your looking at where you are going to spawn and typr save again to get camera pos



Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)