30.06.2014, 09:24
Make sure you have defined the files first.
Try this:
Also, make sure you have skins.txt in your scriptfiles folder.
Try this:
pawn Код:
#include <a_samp>
#include <mSelection>
new skinlist = mS_INVALID_LISTID;
public OnFilterScriptInit()
{
skinlist = LoadModelSelectionMenu("skins.txt");
return 1;
}
public OnPlayerSpawn(playerid)
{
if(pNewlyRegged[playerid])
{
ShowModelSelectionMenu(playerid, skinlist, "Skin Selection");
RandomSpawnLoc(playerid);
}
if(IsPlayerConnected(playerid))
{
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SetPlayerToTeamColor(playerid);
Logged[playerid] = 1;
}
if(PlayerInfo[playerid][pPos_x] == 0 && PlayerInfo[playerid][pPos_y] == 0)
{
SetPlayerPos(playerid, 1271.3654,181.0756,19.4705);
Logged[playerid] = 1;
}
else
{
SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
Logged[playerid] = 1;
}
return 1;
}
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == skinlist)
{
if(response)
{
new string[35];
format(string, 30, "{3685BA}SERVER: {FFFFFF}You have set your skin to ID %d!", modelid);
SendClientMessage(playerid, -1, string);
}
else SendClientMessage(playerid, -1, "{3685BA}SERVER: {FFFFFF}You must select a skin.");
ShowModelSelectionMenu(playerid, skinlist, "Skin Selection");
return 1;
}
return 1;
}