SA-MP Forums Archive
Random Spawns - 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: Random Spawns (/showthread.php?tid=85384)

Pages: 1 2


Random Spawns - Geekzor - 07.07.2009

what is wrong with my Random Spawns ? here ucan check

http://pastebin.com/d6704c71b

when i compile it i get

C:\Documents and Settings\Administrator\Desktop\Server\gamemodes\te st.pwn(101) : error 004: function "SetPlayerRandomSpawn" is not implemented
C:\Documents and Settings\Administrator\Desktop\Server\gamemodes\te st.pwn(210) : warning 203: symbol is never used: "gRandomPlayerSpawns"
C:\Documents and Settings\Administrator\Desktop\Server\gamemodes\te st.pwn(210) : warning 203: symbol is never used: "iSpawnSet"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


can u tell me what i must add to gamemode or delete

EDIT: i try help with Lvdm - moneyrush game mode but cant make with out errors

Ty


Re: Random Spawns - Gimax - 07.07.2009

Код:
public OnPlayerSpawn(playerid)
{
  SetPlayerRandomSpawn(playerid);
	return 1;
}
for that you need following callback, with function that makes player spawn random

Код:
public SetPlayerRandomspawn(playerid)
{
   // load cords etc
   return 1;
}
and that i didnt find in your script




OR you can put simple function without call back

put this in OnPlayerSpawn
Код:
new id = sizeof(gRandomPlayerSpawns); // or you can just put 24 etc, how much you have
SetPlayerPos(playerid,gRandomPlayerSpawns[id][0],gRandomPlayerSpawns[id][1],gRandomPlayerSpawns[id][2]}



Re: Random Spawns - 6tynine - 07.07.2009

call backs?

pawn Код:
public SetPlayerRandomSpawn(playerid)

{
  new rand;
  rand = random(sizeof(gRandomPlayerSpawns));
  SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]);

  return 1;

}
try that


Re: Random Spawns - Gimax - 07.07.2009

OR you can just copy-paste Upper code =)


Re: Random Spawns - Geekzor - 07.07.2009

ty to all it works btw some ppl saj ''callbacks ? '' the problem is i dont know what is this so i ask for help and now it works

but problem is , when i chose skin and spawn my character is ''rotate''

in debug i /save him hes face is on north but when i spawn him his face is on ''east'' - wall ... anyone can help ?


Re: Random Spawns - refshal - 07.07.2009

I could probably. Show me your saved position.


Re: Random Spawns - Kyosaur - 07.07.2009

Quote:
Originally Posted by Geekzor
ty to all it works btw some ppl saj ''callbacks ? '' the problem is i dont know what is this so i ask for help and now it works

but problem is , when i chose skin and spawn my character is ''rotate''

in debug i /save him hes face is on north but when i spawn him his face is on ''east'' - wall ... anyone can help ?
Try https://sampwiki.blast.hk/wiki/SetPlayerFacingAngle


Re: Random Spawns - yom - 07.07.2009

Quote:
Originally Posted by Geekzor
btw some ppl saj ''callbacks ? '' the problem is i dont know what is this so i ask for help and now it works
Don't listen to them, they don't know what they are talking about. That is not a callback. SetPlayerRandomSpawn(playerid) doesn't need to be public.


Re: Random Spawns - Geekzor - 07.07.2009

Quote:
Originally Posted by cοοp
I could probably. Show me your saved position.
your saved position how do u mean that ? in my first post here u have all what i have in my game mode


Re: Random Spawns - refshal - 07.07.2009

Quote:
Originally Posted by Geekzor
your saved position how do u mean that ? in my first post here u have all what i have in my game mode
Sorry, I didn't read it carefully. <_<
But I think that it isn't possilble to add a certain angle to a random position.


Re: Random Spawns - Geekzor - 07.07.2009

and i have another question

Ok here as u guys see i modify my game mode to ''real one''

so i have a problem with my class selection

soo look at this pictures:

here my class selection must be in this CLUB in IDLEWOOD :

/imageshack/i/samp439z.png/

But when i go to my game when i wanna chose my clases is class selection like that ? wtf

/imageshack/i/samp438.png/

and here is my pstebein code on OnPlayerRequestClass

http://pastebin.com/d60eb3d00

This is all

Can anyone help me ?

Ty


Re: Random Spawns - refshal - 07.07.2009

Type /interior in-game to see which interior you currently are placed in. And then use SetPlayerInterior.


Re: Random Spawns - Geekzor - 07.07.2009

Quote:
Originally Posted by еddy
Type /interior in-game to see which interior you currently are placed in. And then use SetPlayerInterior.
can u tell me more about this ? is possible that u show me in my game mode ?

http://pastebin.com/d60eb3d00 - here

i hope u can show and post the code

ty


Re: Random Spawns - refshal - 07.07.2009

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 487.4664,-3.3493,1002.3828);
    SetPlayerFacingAngle(playerid, 182.1933);
    SetPlayerInterior(playerid, 1); // Example interior, type /interior in-game to find out exactly which interior you are placed in.
    SetPlayerCameraPos(playerid, 487.4526,-5.3850,1002.0781);
    SetPlayerCameraLookAt(playerid, 487.4664,-3.3493,1002.3828);
    return 1;
}



Re: Random Spawns - Geekzor - 07.07.2009

Quote:
Originally Posted by еddy
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 487.4664,-3.3493,1002.3828);
    SetPlayerFacingAngle(playerid, 182.1933);
    SetPlayerInterior(playerid, 1); // Example interior, type /interior in-game to find out exactly which interior you are placed in.
    SetPlayerCameraPos(playerid, 487.4526,-5.3850,1002.0781);
    SetPlayerCameraLookAt(playerid, 487.4664,-3.3493,1002.3828);
    return 1;
}
you mean amm in sa-mp debug ?


Re: Random Spawns - Geekzor - 07.07.2009

yee it works ty


Re: Random Spawns - Geekzor - 07.07.2009

It works ty


Re: Random Spawns - PlayMaker - 07.07.2009

Could u plz help me with this:

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

?

Regards

btw:

pawn Код:
new Float:gRandomPlayerSpawns[1][3] = {
//{X, Y, Z},
//{X, Y, Z},
//{X, Y, Z},
{-2227.3806,2327.0906,7.5469}
};
Then, on public OnPlayerSpawn:

pawn Код:
rand = random(sizeof(gRandomPlayerSpawns));
SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player



Re: Random Spawns - refshal - 07.07.2009

Quote:
Originally Posted by Geekzor
yee it works ty
You're welcome.


Re: Random Spawns - Geekzor - 07.07.2009

its not soo good as it look now when i join in my game my map dont load lol it looks like this and i wiat 5 min ...

/imageshack/i/samp440.png/

anyone can help please ?

ty