Request Classes -
AnonScripter - 23.10.2013
well i made a skin save command, to save the skin to spawn the player in the current skin on next time he logged in..
so how to make this command makes the classes switching disabled, and to be only one skin choose able (the saved skin).
what i make is this, and didn't work.....
i put this under on game mode in it callback:
Notes After reading the code:
PlayerInfo[i][pSkinSave]: its set to 1 when the player type the save skin command.
PlayerInfo[i][pSkin] = Get Player Skin (playerid).
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pSkinSave] == 1)
{
AddPlayerClass(PlayerInfo[i][pSkin],2128.4822,1144.7655,13.5090,101.9559,0,0,0,0,0,0);
}
}
}
Respuesta: Request Classes -
Alex_Obando - 23.10.2013
pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pSkinSave] == 1)
{
AddPlayerClass(PlayerInfo[i][pSkin],2128.4822,1144.7655,13.5090,101.9559,0,0,0,0,0,0);
}
}
}
SpawnPlayer(playerid); //Disables Choosing any class.
return 1;
}
Re: Request Classes -
AnonScripter - 23.10.2013
didn't work, i want to make only one class in the request class if the player use skin save command, and can't switch to any other skin, he jusy can click on 'spawn' button.
your method just makes the "arrows" [ <-- spawn -->] spawn the player instead of 'spawn' button.
Re: Request Classes -
-=Dar[K]Lord=- - 23.10.2013
Dude You mean to say that the player will spawn with the same skin the next time he logs in?
If yes then try this out...
pawn Код:
public OnPlayerSpawn(playerid)
{
if(PlayerInfo[i][pSkinSave] == 1)
{
SetPlayerSkin(playerid,pSkin);
}
return 1;
}
Re: Request Classes -
AnonScripter - 23.10.2013
Quote:
Originally Posted by -=Dar[K]Lord=-
Dude You mean to say that the player will spawn with the same skin the next time he logs in?
If yes then try this out...
pawn Код:
public OnPlayerSpawn(playerid) { if(PlayerInfo[i][pSkinSave] == 1) { SetPlayerSkin(playerid,pSkin); } return 1; }
|
this will spawn the player in the same skin he saved last time, even if he choose another skin in request class.
all i want is to abort all skins in GameModeInIt (AddPlayerClass) and add only one class "the saved skin"
it's not that hard to get the idea, most of servers uses this, how they do it !!!!!
Re: Request Classes -
Zex Tan - 24.10.2013
Chill~
Use SetSpawnInfo (Little bit like AddPlayerClass but its different) afterwards add SpawnPlayer function at OnPlayerRequestClass.
If its not working, please post your reply here.
Re: Request Classes -
AnonScripter - 24.10.2013
well no one know how to do it -.-
anyway okay
Re: Request Classes -
JonnyDeadly - 25.10.2013
I'm not entirely sure about your coding logic/specification here, but I've provided an example below of what I believe you are looking for:
pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
// Your camera/player positioning data etc goes here.
if(PlayerInfo[playerid][pSkinSave] == 1) // If the player has previously saved their skin...
{
AddPlayerClass(PlayerInfo[playerid][pSkin],2128.4822,1144.7655,13.5090,101.9559,0,0,0,0,0,0); // ... Allow them one class to select.
}
else // If the player has not previously saved their skin...
{
for(new i = 0; i < 300; i++) // ... Cycle between the skins SA-MP have to offer...
{
AddPlayerClass(i,0.0,0.0,0.0,0.0,0,0,0,0,0,0); // ... Add each SA-MP skin cycled through.
}
}
return 1;
}
Re: Request Classes -
AnonScripter - 01.11.2013
Quote:
Originally Posted by JonnyDeadly
I'm not entirely sure about your coding logic/specification here, but I've provided an example below of what I believe you are looking for:
pawn Код:
public OnPlayerRequestClass(playerid,classid) { // Your camera/player positioning data etc goes here. if(PlayerInfo[playerid][pSkinSave] == 1) // If the player has previously saved their skin... { AddPlayerClass(PlayerInfo[playerid][pSkin],2128.4822,1144.7655,13.5090,101.9559,0,0,0,0,0,0); // ... Allow them one class to select. } else // If the player has not previously saved their skin... { for(new i = 0; i < 300; i++) // ... Cycle between the skins SA-MP have to offer... { AddPlayerClass(i,0.0,0.0,0.0,0.0,0,0,0,0,0,0); // ... Add each SA-MP skin cycled through. } } return 1; }
|
i tried this, and not working