Please i need your help
#1

Hey, how can i set different places to spawn my players? for excable, i want the player Nickx to spawn in a place that i will choose, and player MatrixX to spawn in other place, how to do this in my gamemode?
Reply
#2

Well you would have to get the player names when they spawn and move them to the cords you would like.

functions needed:
pawn Код:
GetPlayerName
SetPlayerPos
SetPlayerInterior(maybe)
SetPlayerVirtualWorld(maybe)
Use the GetPlayerName function when they spawn and then if the names are detected send them to the selected cords you would like.
Reply
#3

Quote:
Originally Posted by Steven82
Посмотреть сообщение
Well you would have to get the player names when they spawn and move them to the cords you would like.

functions needed:
pawn Код:
GetPlayerName
SetPlayerPos
SetPlayerInterior(maybe)
SetPlayerVirtualWorld(maybe)
Use the GetPlayerName function when they spawn and then if the names are detected send them to the selected cords you would like.
and where i must put this options?
Gamemodeinit?

Код:
GetPlayerName
SetPlayerPos
SetPlayerInterior(maybe)
SetPlayerVirtualWorld(maybe)
Reply
#4

Quote:
Originally Posted by NitoPSG
Посмотреть сообщение
and where i must put this options?
Gamemodeinit?

Код:
GetPlayerName
SetPlayerPos
SetPlayerInterior(maybe)
SetPlayerVirtualWorld(maybe)
Reply
#5

With GetPlayerName https://sampwiki.blast.hk/wiki/GetPlayerName
you get there name example Noob you do the scripting part im not doing it for you once you get there name SetPlayerPos(playerid,....); after that check if you are using a interior (inside a building) if not dont even use it.
Reply
#6

Quote:
Originally Posted by Kitten
Посмотреть сообщение
With GetPlayerName https://sampwiki.blast.hk/wiki/GetPlayerName
you get there name example Noob you do the scripting part im not doing it for you once you get there name SetPlayerPos(playerid,....); after that check if you are using a interior (inside a building) if not dont even use it.
Yea I know that but where must I put the script (GetPlayerName etc.)
under where? Gamemodeinit??
Reply
#7

You can do this:

Add this under OnPlayerSpawn
pawn Код:
new
    pName[MAX_PLAYER_NAME];

GetPlayerName(playerid, pName, sizeof(pName));

if(strcmp(pName, "ThePlayersName", true) == 0)
{
    SetPlayerPos(playerid, X, Y, Z);
}
else if(strcmp(pName, "TheOtherPlayersName", true) == 0)
{
    SetPlayerPos(playerid, X, Y, Z);
}
If you are planning to add more names, make an array then loop through it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)