0.3x selection menu /buyclothes
#1

hello guys,
for my server i was trying to make a selection menu for /buyclothes but i can't figure it out.. could someone help me

here is the command if you can help me
Код:
    if(strcmp(cmd, "/Buyclothes", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
        	if(IsAtClothShop(playerid))
	        {
	            tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_WHITE,"USAGE: /Buyclothes [Skin ID]");
					return 1;
				}
				new level = strval(tmp);

				GivePlayerMoney(playerid,-200);
				SafeGivePlayerMoney(playerid, - 200);
	            if(!IsValidSkin(level))
				return SendClientMessage(playerid, COLOR_GREY, "Wrong skin ID!");
			    PlayerInfo[playerid][pModel] = level;
				SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
	    	}
	    }
	    return 1;
	}
Reply
#2

Use
pawn Код:
new skinlist = mS_INVALID_LISTID;
pawn Код:
if(strcmp(cmd, "/Buyclothes", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsAtClothShop(playerid))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_WHITE,"USAGE: /Buyclothes [Skin ID]");
                    return 1;
                }
                new level = strval(tmp);

                GivePlayerMoney(playerid,-200);
                SafeGivePlayerMoney(playerid, - 200);
                ShowModelSelectionMenu(playerid, skinlist, "Select Skin");
            }
        }
        return 1;

    }
place this OnGameModeInit()
pawn Код:
skinlist = LoadModelSelectionMenu("skins.txt");
if I'm right this should work download this http://adf.ly/JVfHH and put it in your scriptfile and it should work!
Reply
#3

Quote:
Originally Posted by McFellow
Посмотреть сообщение
Use
pawn Код:
new skinlist = mS_INVALID_LISTID;
pawn Код:
if(strcmp(cmd, "/Buyclothes", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsAtClothShop(playerid))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_WHITE,"USAGE: /Buyclothes [Skin ID]");
                    return 1;
                }
                new level = strval(tmp);

                GivePlayerMoney(playerid,-200);
                SafeGivePlayerMoney(playerid, - 200);
                ShowModelSelectionMenu(playerid, skinlist, "Select Skin");
            }
        }
        return 1;

    }
place this OnGameModeInit()
pawn Код:
skinlist = LoadModelSelectionMenu("skins.txt");
if I'm right this should work download this http://adf.ly/JVfHH and put it in your scriptfile and it should work!
i get these errors.. do i need a plugin or include?

Код:
C:\Users\JordanDrummer\Desktop\Maxed Out Roleplay\gamemodes\MaxedOutRoleplay.pwn(1423) : error 017: undefined symbol "mS_INVALID_LISTID"
C:\Users\JordanDrummer\Desktop\Maxed Out Roleplay\gamemodes\MaxedOutRoleplay.pwn(1423) : error 008: must be a constant expression; assumed zero
C:\Users\JordanDrummer\Desktop\Maxed Out Roleplay\gamemodes\MaxedOutRoleplay.pwn(20003) : error 017: undefined symbol "LoadModelSelectionMenu"
C:\Users\JordanDrummer\Desktop\Maxed Out Roleplay\gamemodes\MaxedOutRoleplay.pwn(60275) : error 017: undefined symbol "ShowModelSelectionMenu"
C:\Users\JordanDrummer\Desktop\Maxed Out Roleplay\gamemodes\MaxedOutRoleplay.pwn(60271) : warning 204: symbol is assigned a value that is never used: "level"
C:\Users\JordanDrummer\Desktop\Maxed Out Roleplay\gamemodes\MaxedOutRoleplay.pwn(20003) : warning 204: symbol is assigned a value that is never used: "skinlist"
Reply
#4

Sorry forgot something at this too
pawn Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
    if(listid == skinlist)
    {
        if(response)
        {
            SendClientMessage(playerid, 0xFF0000FF, "Skin Changed");
            SetPlayerSkin(playerid, modelid);
        }
        else SendClientMessage(playerid, 0xFF0000FF, "Canceled skin selection");
        return 1;
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by McFellow
Посмотреть сообщение
Sorry forgot something at this too
pawn Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
    if(listid == skinlist)
    {
        if(response)
        {
            SendClientMessage(playerid, 0xFF0000FF, "Skin Changed");
            SetPlayerSkin(playerid, modelid);
        }
        else SendClientMessage(playerid, 0xFF0000FF, "Canceled skin selection");
        return 1;
    }
    return 1;
}
errors but now 2 more warnings
Код:
C:\Users\JordanDrummer\Desktop\Maxed Out Roleplay\gamemodes\MaxedOutRoleplay.pwn(967) : error 017: undefined symbol "mS_INVALID_LISTID"
C:\Users\JordanDrummer\Desktop\Maxed Out Roleplay\gamemodes\MaxedOutRoleplay.pwn(967) : error 008: must be a constant expression; assumed zero
C:\Users\JordanDrummer\Desktop\Maxed Out Roleplay\gamemodes\MaxedOutRoleplay.pwn(20004) : error 017: undefined symbol "LoadModelSelectionMenu"
C:\Users\JordanDrummer\Desktop\Maxed Out Roleplay\gamemodes\MaxedOutRoleplay.pwn(60276) : error 017: undefined symbol "ShowModelSelectionMenu"
C:\Users\JordanDrummer\Desktop\Maxed Out Roleplay\gamemodes\MaxedOutRoleplay.pwn(60272) : warning 204: symbol is assigned a value that is never used: "level"
C:\Users\JordanDrummer\Desktop\Maxed Out Roleplay\gamemodes\MaxedOutRoleplay.pwn(79907) : warning 235: public function lacks forward declaration (symbol "OnPlayerModelSelection")
Reply
#6

any help please?
Reply
#7

Ensure you have included the server include into the correct file location.
If not, download it from here. https://sampforum.blast.hk/showthread.php?tid=407045

Place in this Location: Serverfile/pawno/includes

Then at the top of the script you'll want to include it by #include <includename>
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)