SA-MP Forums Archive
Please i need your help - 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: Please i need your help (/showthread.php?tid=250533)



Please i need your help - Panormitis - 23.04.2011

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?


Re: Please i need your help - Steven82 - 23.04.2011

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.


Re: Please i need your help - NitoPSG - 23.04.2011

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)



Re: Please i need your help - NitoPSG - 23.04.2011

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

Код:
GetPlayerName
SetPlayerPos
SetPlayerInterior(maybe)
SetPlayerVirtualWorld(maybe)



Re: Please i need your help - Kitten - 23.04.2011

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.


Re: Please i need your help - NitoPSG - 23.04.2011

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??


Re: Please i need your help - [L3th4l] - 23.04.2011

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!