When player types /skin a dialog pops up asking them to insert a ID, sigh.
Post
Your Code request here...
pawn Код:
#include <a_samp>
#include <a_players>
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/skin", true) == 0)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Skin Change", "Enter the skin id you wish to have below", "Confirm", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
new skinid, message[64];
skinid = strval(inputtext);
if(skinid < 0 || skinid > 299)
{
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Skin id may be between 0 and 299.");
}
else
{
SetPlayerSkin(playerid, skinid);
format(message, sizeof(message), "SERVER: You have changed your skin id to %d.", skinid);
SendClientMessage(playerid, 0xFFFFFFFF, message);
}
}
}
return 1;
}
When player stand at a check point dialog pops up prompting them to enter skin ID
pawn Код:
new minimenu; // Will be at Top
minimenu = CreatePickup(234, 23, -2348.942,261.415,2.65); //put this under ongamemodeinit and change the position to binco or anything
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == minimenu)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Rich", "Poor", "Select", "Cancel");!");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new string[128];
if(dialogid == 1 )
{
if(!response)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "nRich", "nPoor", "Select", "Cancel");
TogglePlayerControllable(playerid, 0);
}
if(response)
{
if(listitem == 0)
{
SetPlayerSkin(playerid,23); // choose the skin id by changing the 23 ...
}
}
if(listitem == 1)
{
SetPlayerSkin(playerid, 25); ///// for this one also
}
return 1;
}
This code might generate errors.