Spawn for specific name - 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)
+--- Thread: Spawn for specific name (
/showthread.php?tid=304832)
Spawn for specific name -
SnG.Scot_MisCuDI - 20.12.2011
Sup, how can i get a person spawn at a certain location. Like since my name is, SnG.Scot_MisCuDi, when i log in i will be spawned at coordinates 0,0,0 at interior 11. And then Bill will be spawned at 1,1,1 with interior 1. I need this so players can spawn in there custom house.
Re: Spawn for specific name -
JamesC - 20.12.2011
pawn Код:
new szName[MAX_PLAYER_NAME]; // Create a variable to store the current player's name.
GetPlayerName(playerid, szName, sizeof szName); // Retrieve the player's name.
if(strcmp("SnG.Scot_MisCuDi", szName, true) == 0) { // Compare the player's name with "SnG.Scot_MisCuDi" to see if they match.
// Code here.
} else if(strcmp("Bill", szName, true) == 0) { // Compare the player's name with "Bill" to see if they match.
// Code here for Bill.
} else {
// Code here for all other players
}
Re: Spawn for specific name -
SnG.Scot_MisCuDI - 20.12.2011
i still dont spawn where i want. I just spawn in the normal spot (before code) and my interior still sets to 7 but im outside
pawn Код:
if(strcmp("SnG.Scot_MisCuDi", szName, true) == 0) { // Compare the player's name with "SnG.Scot_MisCuDi" to see if they match.
SetPlayerPos(playerid,226.0224,1025.4611,1084.0078);
SetPlayerFacingAngle( playerid, 360 );
SetPlayerInterior(playerid, 7);
Re: Spawn for specific name -
AstonDA-G - 20.12.2011
pawn Код:
if(strcmp("SNG.Scot_MisCuDi", szName, true) == 0) {
SetPlayerPos(playerid, posx,posy,posz);
SetPlayerFacingAngle(playerid, angle);
SetPlayerInterior(playerid, 7);
}
It seemed to work when I tested it, if you're not spawning in the interior, check a: the interior is solid, b: maybe put the co ordinate Z a little higher, maybe you are falling through, or c: are you sure you got the right world?
Re: Spawn for specific name -
SnG.Scot_MisCuDI - 20.12.2011
i had to take the admin spawn off and it worked. thanks