How can I do the /buyclothes the skin will be saved everytime you enter / exit from the game :
Код:
#include <a_samp>
#include <streamer>
#include <a_zones>
#include <foreach>
#include <yom_buttons>
#include <djson>
#include <progress>
#include <YSI\y_timers>
#include <ZCMD>
#include <sscanf2>
#include <removebuilding_fix>
#include <fire2>
#include <mSelection>
#define COLOR_GRAD2 0xBFC0C2FF
new skinlist = mS_INVALID_LISTID;
public OnFilterScriptInit()
{
skinlist = LoadModelSelectionMenu("skins.txt");
return 1;
}
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == skinlist)
{
if(response)
{
if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid, COLOR_GRAD2, "You can't afford these clothes!");
GameTextForPlayer(playerid, "~g~Skin purchased! ~n~ ~r~- $2500", 2000, 1);
GivePlayerMoney(playerid, -2500);
SetPlayerSkin(playerid, modelid);
}
else SendClientMessage(playerid, 0xFF0000FF, "Canceled skin selection");
return 1;
}
return 1;
}
IsAtClothShop(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,25.0,207.5627,-103.7291,1005.2578) || IsPlayerInRangeOfPoint(playerid,25.0,203.9068,-41.0728,1001.8047) || IsPlayerInRangeOfPoint(playerid,25.0,203.9068,-41.0728,1001.8047))
{//Binco & Suburban
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,30.0,214.4470,-7.6471,1001.2109) || IsPlayerInRangeOfPoint(playerid,50.0,161.3765,-83.8416,1001.8047))
{//Zip & Victim
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,5.0,-2664.3318,1538.4259,907.1797))
{// DoC HQ
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,5.0,1514.66,-1501.12,17.10) || IsPlayerInRangeOfPoint(playerid,5.0,1523.42,-1502.75,17.10))
{// The New Custom Clothes Shop
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,5.0,202.6777,-163.0623,1000.5306))
{//Diedier DoChs
return 1;
}
}
return 0;
}
CMD:buyclothes(playerid, params[])
{
if(IsAtClothShop(playerid))
{
ShowModelSelectionMenu(playerid, skinlist, "Select Skin");
}
return 1;
}
Bascially what you do is add 'LastSkin' to the Saving, Loading, New player data callbacks,