25.04.2013, 12:12
so I have
But I also want
In there, how do i do this?
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new string[124];
switch(dialogid)
{
case 1:
{
if(!response) return Kick(playerid);
if(strlen(inputtext) < 6 || strlen(inputtext) > 32)
{
SendClientMessage(playerid, COL_GREY, "Please enter a password that is greater than 6 characters or less than 32 characters.");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Welcome to "ServerName"", "Enter your desired password below to sucessfully register.", "Continue", "Cancel");
return 1;
}
else
{
RegisterPlayer(playerid, inputtext);
PlayerVar[playerid][Authenticated] = 1;
format(PlayerVar[playerid][Name], MAX_PLAYER_NAME, GetPlayersNameWithUnderScore(playerid));
format(PlayerVar[playerid][Password], 32, "%s", inputtext);
format(PlayerVar[playerid][Accent], 32, "American");
GetPlayerIp(playerid, PlayerVar[playerid][IP], 32);
}
}
case 2:
{
if(!response) return Kick(playerid);
format(string, sizeof(string), "PlayerAccounts/%s.ini", GetPlayersNameWithUnderScore(playerid));
if(fexist(string))
{
if(!strcmp(PlayerVar[playerid][Password], inputtext , false))
{
INI_ParseFile(string, "LoadPlayer_%s", .bExtra = true, .extra = playerid);
PlayerVar[playerid][Authenticated] = 1;
LoginPlayer(playerid);
}
else
{
SendClientMessage(playerid, COL_GREY, "The password you entered does not match, please reconnect for another try.");
Kick(playerid);
}
}
}
}
return 1;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_WEAPONS)
{
if(response) // If they clicked 'Select' or double-clicked a weapon
{
// Give them the weapon
if(listitem == 0) // They selected the first item - Desert Eagle
{
GivePlayerWeapon(playerid, WEAPON_DEAGLE, 14); // Give them a desert eagle
}
if(listitem == 1) // They selected the second item - AK-47
{
GivePlayerWeapon(playerid, WEAPON_AK47, 120); // Give them an AK-47
}
if(listitem == 2) // They selected the third item - Desert Eagle
{
GivePlayerWeapon(playerid, WEAPON_SHOTGSPA, 28); // Give them a Combat Shotgun
}
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}
return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}


