SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 19/05/2013, 12:25 PM   #1
chuck100
Big Clucker
 
Join Date: Dec 2012
Posts: 74
Reputation: -10
Default BuyClothes Bug Save

How can I do the /buyclothes the skin will be saved everytime you enter / exit from the game :

Code:
#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;
}
chuck100 is offline   Reply With Quote
Old 19/05/2013, 03:53 PM   #2
chuck100
Big Clucker
 
Join Date: Dec 2012
Posts: 74
Reputation: -10
Default Re: BuyClothes Bug Save

Anybody ?
chuck100 is offline   Reply With Quote
Old 19/05/2013, 04:55 PM   #3
Ceez
Big Clucker
 
Join Date: Oct 2012
Posts: 76
Reputation: 22
Default Re: BuyClothes Bug Save

I don't know what Saving-System are you using but,
Go to the callback of the New Player Data, example
Code:
public NewPlayerData(playerid)
{
    if(INI_Open(Accounts(playerid)))
    {
         INI_WriteInt("LastSkin");
Bascially what you do is add 'LastSkin' to the Saving, Loading, New player data callbacks,
Then OnPlayerSpawn add
Code:
SetSkin(playerid, PlayerStat[playerid][LastSkin]
If you don't have
Code:
PlayerStat
, use
Code:
PlayerInfo
or just
Code:
pInfo
, whatever you got.
Ceez is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command BuyClothes Problem chuck100 Scripting Help 1 15/05/2013 11:33 PM
0.3x selection menu /buyclothes Godzilla8957 Scripting Help 6 21/02/2013 12:48 AM
[Help] Buyclothes command Thrarod Help Archive 0 11/04/2010 07:48 AM
BuyClothes icorne Help Archive 5 02/02/2010 04:49 PM
/buyclothes cmd ain't working Castle Help Archive 2 25/03/2009 06:33 PM


All times are GMT. The time now is 11:30 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.