Spawn for specific name
#1

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.
Reply
#2

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
}
Reply
#3

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);
Reply
#4

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?
Reply
#5

i had to take the admin spawn off and it worked. thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)