mSelection problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mSelection problem (
/showthread.php?tid=553661)
mSelection problem -
VincenzoDrift - 30.12.2014
I make this skin selector, but i see only 20 skin (1/1 page)
On Top:
pawn Код:
#undef mS_CUSTOM_MAX_ITEMS
#define mS_CUSTOM_MAX_ITEMS 301
#define MS_SKIN_LIST 0
new skin[MAX_PLAYERS][300];
OnPlayerConnect:
pawn Код:
public OnPlayerConnect(playerid)
{
for(new i = 0; i <= 299; i++)
{
skin[playerid][i] = i;
}
return 1;
}
ZCMD Command:
pawn Код:
CMD:skin(playerid, params[])
{
ShowModelSelectionMenuEx(playerid, skin[playerid], 300, "Skin Selector", MS_SKIN_LIST, 0.0, 0.0, 0.0, 1.0);
return 1;
}
OnPlayerModelSelectionEx:
pawn Код:
public OnPlayerModelSelectionEx(playerid, response, extraid, modelid)
{
if(extraid == MS_SKIN_LIST)
{
if(response)
{
SetPlayerSkin(playerid, modelid);
format(string1, sizeof(string1), "[INFO]: You have set skinid %d", modelid);
SendClientMessage(playerid, YELLOW, string1);
}
}
return 1;
}
Re : mSelection problem -
MCZOFT - 30.12.2014
thsi one will work for sure ,i rebuilt it again
PHP код:
new skinlist = mS_INVALID_LISTID;
PHP код:
CMD:skin(playerid, params[])
{
ShowModelSelectionMenu(playerid, skinlist, "Select Skin");
return 1;
}
PHP код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == skinlist)
{
if(response)
{
new giveplayerid;
PlayerInfo[giveplayerid][pChar] = modelid;
PlayerInfo[giveplayerid][pModel] = modelid;
SendClientMessage(playerid, COLOR_RED, "Write here your text .. ");
SetPlayerSkin(giveplayerid, PlayerInfo[giveplayerid][pChar]);
}
else SendClientMessage(playerid, COLOR_RED, "You've choosed to leave that clothes shop");
return 1;
}
return 1;
}
//----------------------------------------------------------------------------//
you can change the
PlayerInfo[giveplayerid][pChar]
PlayerInfo[giveplayerid][pmodel] with yours , because i took it from my Gamemode
PHP код:
skinlist = LoadModelSelectionMenu("PATH(scriptfiles)/skins.txt");
skins.txt
http://pastebin.com/guq8xvC5