22.02.2013, 05:25
They are called Model previews. It is easy to make using Doefl0r's mSelection include. ****** it.
Example script:
You will need to make a 'weapons.txt' file in your scriptfiles. Read the mSelection topic here to know about it.
You can find the weapon object ids here. They start from 331.
Example script:
pawn Код:
#include <a_samp>
#include <mSelection>
new weplist = mS_INVALID_LISTID;
public OnFilterScriptInit()
{
weplist = LoadModelSelectionMenu("weapons.txt");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/weapons", true) == 0)
{
ShowModelSelectionMenu(playerid, weplist, "->Weapons<-");
return 1;
}
return 0;
}
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == weplist)
{
if(response)
{
SendClientMessage(playerid, 0xFF0000FF, "Chosen a weapon.");
}
else SendClientMessage(playerid, 0xFF0000FF, "Canceled selection");
return 1;
}
return 1;
}
You can find the weapon object ids here. They start from 331.