31.08.2015, 10:19
After you save the skin ID to a database, load it into a variable under 'OnAccountLoad' and use SetPlayerSkin under OnPlayerSpawn, like so:
Or use it directly as the third parameter in SetSpawnInfo defines with which skin ID they spawn.
Edit: I admit, I half-misread what you wanted there.
To let players have some way of selecting a skin, you have two options: use the old way, or the new way.
The old way is maybe more complicated, but you still have to use some part of it.
The old way consisted of this: you add the classes (skins with predefined weapons as they spawn etc.) under OnGameModeInit (when the server loads) then under OnPlayerRequestClass (when they get to choose the skin) you set their camera position to look at the skin to select and they choose it with '<<' '>>' buttons. I can't explain it to you any better, go take a look at the 'grandlarc.pwn' (Grand Larceny) game mode included with the server.
The new way is with text draws. You show the player a text draw menu with skin models and they choose which one they want with a simple mouse click! See here.
Код:
public OnPlayerSpawn(playerid) { if (Player[playerid][ID] > 0) // check if player is registered { SetPlayerSkin(playerid, Player[playerid][SkinID]); } return 1; }
Edit: I admit, I half-misread what you wanted there.
To let players have some way of selecting a skin, you have two options: use the old way, or the new way.
The old way is maybe more complicated, but you still have to use some part of it.
The old way consisted of this: you add the classes (skins with predefined weapons as they spawn etc.) under OnGameModeInit (when the server loads) then under OnPlayerRequestClass (when they get to choose the skin) you set their camera position to look at the skin to select and they choose it with '<<' '>>' buttons. I can't explain it to you any better, go take a look at the 'grandlarc.pwn' (Grand Larceny) game mode included with the server.
The new way is with text draws. You show the player a text draw menu with skin models and they choose which one they want with a simple mouse click! See here.