New Question..
#1

Is there a way to set spawn points of players using:

public OnPlayerRequestClass(playerid, classid)
{
SetSpawnInfo(playerid, 0, 299, 2495.3494, -1687.0780, 13.5152, 358.8612, 26, 36, 28, 150, 46, 1 );
return 1;
}

But make it specific per player.

I.e. john doe setspawninfo = (playerid, 0, 299, 2495.3494, -1687.0780, 13.5152, 358.8612, 26, 36, 28, 150, 46, 1 );
While jane does setspawninfo = (playerid, 0, 281, 2486.3142, -1647.9170, 14.0703, 182.1866, 26, 36, 28, 150, 46, 1 );

Any help is greatly appreciated!
Reply
#2

What do you think the playerid parameter is for?
Reply
#3

ah you can even add this in this way:
pawn Код:
public OnPlayerSpawn(playerid)
{
if(He is john doe codes...)
{
SetPlayerPos(playerid, 281, 2486.3142, -1647.9170, 14.0703);
//and give him the weapons you like
}
}
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
What do you think the playerid parameter is for?
Edit: That came out retarded
I tried putting the playerid in that parameter but it comes up saying:

' error 017: undefined symbol "johndoe" '

Quote:
Originally Posted by fatninja
Посмотреть сообщение
ah you can even add this in this way:
pawn Code:
public OnPlayerSpawn(playerid)
{
if(He is john doe codes...)
{
SetPlayerPos(playerid, 281, 2486.3142, -1647.9170, 14.0703);
//and give him the weapons you like
}
}
What is the ''(he is john doe codes...)''

Then could I apply that code to 'OnPlayerRequestClass'?
Reply
#5

pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
    new
        name[ MAX_PLAYER_NAME ]
    ;
    GetPlayerName( playerid, name, MAX_PLAYER_NAME );
    if( !strcmp( name, "john_doe", true ) ) SetSpawnInfo( playerid, 0, 299, 2495.3494, -1687.0780, 13.5152, 358.8612, 26, 36, 28, 150, 46, 1 );
    else if( !strcmp( name, "jane_does", true ) ) SetSpawnInfo( playerid, 0, 281, 2486.3142, -1647.9170, 14.0703, 182.1866, 26, 36, 28, 150, 46, 1 );
    else SetSpawnInfo( playerid, 0, 299, x, y, z, angle, 26, 36, 28, 150, 46, 1 ); // Change the coordinates
    return 1;
}
Reply
#6

Quote:
Originally Posted by Dwane
Посмотреть сообщение
pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
    new
        name[ MAX_PLAYER_NAME ]
    ;
    GetPlayerName( playerid, name, MAX_PLAYER_NAME );
    if( !strcmp( name, "john_doe", true ) ) SetSpawnInfo( playerid, 0, 299, 2495.3494, -1687.0780, 13.5152, 358.8612, 26, 36, 28, 150, 46, 1 );
    else if( !strcmp( name, "jane_does", true ) ) SetSpawnInfo( playerid, 0, 281, 2486.3142, -1647.9170, 14.0703, 182.1866, 26, 36, 28, 150, 46, 1 );
    else SetSpawnInfo( playerid, 0, 299, x, y, z, angle, 26, 36, 28, 150, 46, 1 ); // Change the coordinates
    return 1;
}
Dwayne you are a Gent and a Scholar good Sir!
Reply
#7

i do think so it can be applied but i tink it could be in onPlayerConnect by setting the spawn info then Spawning him.
and your second problem thing of John_Codes
you only need it for a single player John_Codes,i dont think so
he is john Joe codes could be a thing like he is a admin level 5 so
if(PlayerInfo[pAdmin][playeid]==5)
or something you need and if you want it for all players then make a global varibal like
new SpawnChanger=1;
and in where you are using the spawn player codes
do
if(SpawnChange==1)
{
//your codes......
}
and when you want to stop the spawn changer set the SpawnChange to 0 by
SpawnChange=0;
you can do it from ingame with the help of commands
EDITorry i took a long time to write and the above post came so please dont mind if my post was use less
Reply
#8

Also, do i just copy the 'else if' line and change parameters for any new players I want to set specific spawn points for?
Reply
#9

Quote:
Originally Posted by WhiteDevil
Посмотреть сообщение
Also, do i just copy the 'else if' line and change parameters for any new players I want to set specific spawn points for?
Yes, if you want to add more names, you can add as many as lines with else if you want. Just don't overdo it!
Reply
#10

Quote:
Originally Posted by Dwane
Посмотреть сообщение
Yes, if you want to add more names, you can add as many as lines with else if you want. Just don't overdo it!
I doubt i'll have that many people on my server, but just in case! Again, thanks for the help!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)