Posts: 737
Threads: 338
Joined: Jan 2013
Hi,
I want to show player, a meniu, but problem is i don't know, how to show skins, from player variables? because i do in my server, you can have 10 skin. But now, i just can show that ShowModelSelectionMenu, just skins, from file, when i load it when gamemode starts, but how show player skins, or skins, what i want?
womanlist = LoadModelSelectionMenu("skinswoman.TXT");
ShowModelSelectionMenu(playerid, womanlist, "Woman skins", DIALOG_BG_COLOR, PREV_BG_COLOR, PREV_BG_COLOR2); // Ļīźąēūāąеģ čćљīźу ģеķћ ń āūįīљīģ īљуęč˙.
But here i can just load skins from file... Because all players, can have different skins, i need to show just that skins, who player have in variables, but how do it?
Posts: 737
Threads: 338
Joined: Jan 2013
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
Don't bump until 24 hours have passed.
Posts: 737
Threads: 338
Joined: Jan 2013
You must write this shit..
Posts: 737
Threads: 338
Joined: Jan 2013
Yes, but i think here is that people, who can do it..
Code:
stock LoadModelSelectionMenu(f_name[])
{
new File:f, str[75];
format(str, sizeof(str), "%s", f_name);
f = fopen(str, io_read);
if( !f ) {
printf("-mSelection- WARNING: Failed to load list: \"%s\"", f_name);
return mS_INVALID_LISTID;
}
if(gListAmount >= mS_TOTAL_LISTS)
{
printf("-mSelection- WARNING: Reached maximum amount of lists, increase \"mS_TOTAL_LISTS\"", f_name);
return mS_INVALID_LISTID;
}
new tmp_ItemAmount = gItemAmount; // copy value if loading fails
new line[128], idxx;
while(fread(f,line,sizeof(line),false))
{
if(tmp_ItemAmount >= mS_TOTAL_ITEMS)
{
printf("-mSelection- WARNING: Reached maximum amount of items, increase \"mS_TOTAL_ITEMS\"", f_name);
break;
}
idxx = 0;
if(!line[0]) continue;
new mID = strval( mS_strtok(line,idxx) );
if(0 <= mID < 20000)
{
gItemListg[tmp_ItemAmount][mS_ITEM_MODEL] = mID;
new tmp_mS_strtok[20];
new Float:mRotation[3], Float:mZoom = 1.0;
new bool:useRotation = false;
tmp_mS_strtok = mS_strtok(line,idxx);
if(tmp_mS_strtok[0]) {
useRotation = true;
mRotation[0] = floatstr(tmp_mS_strtok);
}
tmp_mS_strtok = mS_strtok(line,idxx);
if(tmp_mS_strtok[0]) {
useRotation = true;
mRotation[1] = floatstr(tmp_mS_strtok);
}
tmp_mS_strtok = mS_strtok(line,idxx);
if(tmp_mS_strtok[0]) {
useRotation = true;
mRotation[2] = floatstr(tmp_mS_strtok);
}
tmp_mS_strtok = mS_strtok(line,idxx);
if(tmp_mS_strtok[0]) {
useRotation = true;
mZoom = floatstr(tmp_mS_strtok);
}
if(useRotation)
{
new bool:foundRotZoom = false;
for(new i=0; i < gRotZoomAmount; i++)
{
if(gRotZoom[i][0] == mRotation[0] && gRotZoom[i][1] == mRotation[1] && gRotZoom[i][2] == mRotation[2] && gRotZoom[i][3] == mZoom)
{
foundRotZoom = true;
gItemListg[tmp_ItemAmount][mS_ITEM_ROT_ZOOM_ID] = i;
break;
}
}
if(gRotZoomAmount < mS_TOTAL_ROT_ZOOM)
{
if(!foundRotZoom)
{
gRotZoom[gRotZoomAmount][0] = mRotation[0];
gRotZoom[gRotZoomAmount][1] = mRotation[1];
gRotZoom[gRotZoomAmount][2] = mRotation[2];
gRotZoom[gRotZoomAmount][3] = mZoom;
gItemListg[tmp_ItemAmount][mS_ITEM_ROT_ZOOM_ID] = gRotZoomAmount;
gRotZoomAmount++;
}
}
else print("-mSelection- WARNING: Not able to save rotation/zoom information. Reached maximum rotation/zoom information count. Increase '#define mS_TOTAL_ROT_ZOOM' to fix the issue");
}
else gItemListg[tmp_ItemAmount][mS_ITEM_ROT_ZOOM_ID] = -1;
tmp_ItemAmount++;
}
}
if(tmp_ItemAmount > gItemAmount) // any models loaded ?
{
gLists[gListAmount][mS_LIST_START] = gItemAmount;
gItemAmount = tmp_ItemAmount; // copy back
gLists[gListAmount][mS_LIST_END] = (gItemAmount-1);
gListAmount++;
return (gListAmount-1);
}
printf("-mSelection- WARNING: No Items found in file: %s", f_name);
return mS_INVALID_LISTID;
}
Posts: 844
Threads: 32
Joined: Apr 2009
Reputation:
0
As RealCop mentioned, you're one of thousands. People have their own lives, and you're going to have to wait until one of them can help you.
Now I did a quick check and I noticed that MSelection has another function.
ShowModelSelectionMenuEx
The second parameter in this function doesn't require a file to read the data from, unlike the other one.
The second parameter is a list, array of items. So you can implement your own array with the items you want.
Kind regards,
Mike Peterson