01.04.2013, 02:16
Okay so, i'm trying to script a re-script my clothing shop system. All I was that I replaced the dialog that shows up on /buyclothes with the code below(of course i've placed the code onto the correct places):
and here is my skins.txt: Pastebin
Firstly it said that "mS_CUSTOM_MAX_ITEMS" had to be increased, good I increased them to 300 but still, when i type the command i crash.
pawn Код:
#include <mSelection>
new skinlist = mS_INVALID_LISTID;
OnGameModeInit(){
skinlist = LoadModelSelectionMenu("skins.txt");
}
CMD:buyclothes(playerid, params[])
{
if(IsAtClothShop(playerid))
{
ShowModelSelectionMenu(playerid, skinlist, "Select Skin");
}
else
{
SendClientMessage( playerid, COLOR_WHITE, "You are not in a Clothing Store!" );
}
return 1;
}
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == skinlist)
{
if(response)
{
new string[128];
format(string, sizeof(string), "** You have purchased skinid: %i for $600", modelid);
SendClientMessageEx(playerid, 0xFF0000FF, string);
SetPlayerSkin(playerid, modelid);
GivePlayerCash(playerid, -600);
PlayerInfo[playerid][pModel] = modelid;
}
else SendClientMessage(playerid, 0xFF0000FF, "Canceled skin selection");
return 1;
}
return 1;
}
Firstly it said that "mS_CUSTOM_MAX_ITEMS" had to be increased, good I increased them to 300 but still, when i type the command i crash.