Форум Pawn-Wiki.Ru - Воплоти мечту в реальность!: нужна помощь - Форум Pawn-Wiki.Ru - Воплоти мечту в реальность!

Перейти к содержимому

Страница 1 из 1
  • Вы не можете создать новую тему
  • Вы не можете ответить в тему

[ Pawn ]
нужна помощь

#1
Пользователь офлайн   FlixTco 

  • Прохожий
  • Вставить ник
  • Раскрыть информацию
вопщем сделал я выбор скина при регистрации но кнопки вперед и назад не как нереагирует не'зню вчем может быть проблема может вызнаете помогите пожалуйста вот код
#include <a_samp>
#include <mxINI>

new SkinPed[MAX_PLAYERS];
new Menu: bich[2];
new SkinMen[5] = { 78,79,137,200,239 };
new SkinGirl[3] = { 12,40,55 };

enum pInfo
{
	pName[MAX_PLAYER_NAME],
	pPass[17],
	pSex,
	pModel,
	pTut,
}
new PlayerInfo[MAX_PLAYERS][pInfo];

public OnGameModeInit()
{
	SetGameModeText("RP");
	bich[0] = CreateMenu("Victim", 1, 50.0, 160.0, 90.0);
 	SetMenuColumnHeader(bich[0], 0, "Choose skin");
  	AddMenuItem(bich[0] ,0,">> Next");
   	AddMenuItem(bich[0] ,0,"<< Back");
   	AddMenuItem(bich[0] ,0,"Enter");

	bich[1] = CreateMenu("Victim", 1, 50.0, 160.0, 90.0);
 	SetMenuColumnHeader(bich[1], 0, "Choose skin");
  	AddMenuItem(bich[1] ,0,"<< Back");
   	AddMenuItem(bich[1] ,0,">> Next");
   	AddMenuItem(bich[1] ,0,"Enter");
	return 1;
}

main(){}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	return 1;
}

public OnPlayerConnect(playerid)
{
	GetPlayerName(playerid,PlayerInfo[playerid][pName],MAX_PLAYER_NAME);

	new string[MAX_PLAYER_NAME + 6 + 4];
	format(string,sizeof(string),"users/%s.ini",PlayerInfo[playerid]
[pName]);
	new openFile = ini_openFile(string);
	if(openFile < 0)
	{
	    ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"???????????","????
??? ??????:","????","?????");
	}
	else
	{
	    ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"???????????","?
?????? ??????:","????","?????");
	    ini_getString(openFile,"Pass",PlayerInfo[playerid][pPass]
);
	    ini_closeFile(openFile);
	}
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		return 1;
	}
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
if(GetPlayerMenu(playerid) == bich[0])
        {
                switch(row)
                {
                        case 0:
                        {
                                if(PlayerInfo[playerid][pSex] == 2)
                                {
                                        SkinPed[playerid]++;
                                        if(SkinPed[playerid] >= 5)
                                        {
                                                SkinPed[playerid] = 0;
                                        }
                                        SetPlayerSkin(playerid,SkinMen[SkinPed[playerid]]);
                                }
                                if(PlayerInfo[playerid][pSex] == 2)
                                {
                                        SkinPed[playerid]++;
                                        if(SkinPed[playerid] >= 3)
                                        {
                                                SkinPed[playerid] = 0;
                                        }
                                        SetPlayerSkin(playerid,SkinGirl[SkinPed[playerid]]);
                                }
                                ShowMenuForPlayer(bich[0],playerid);
                        }
                        case 1:
                        {
                                if(PlayerInfo[playerid][pSex] == 2)
                                {
                                        SkinPed[playerid]--;
                                        if(SkinPed[playerid] <= 0)
                                        {
                                                SkinPed[playerid] = 4;
                                        }
                                        SetPlayerSkin(playerid,SkinMen[SkinPed[playerid]]);
                                }
                                if(PlayerInfo[playerid][pSex] == 2)
                                {
                                        SkinPed[playerid]--;
                                        if(SkinPed[playerid] <= 0)
                                        {
                                                SkinPed[playerid] = 2;
                                        }
                                        SetPlayerSkin(playerid,SkinGirl[SkinPed[playerid]]);
                                }
                                ShowMenuForPlayer(bich[1],playerid);
                        }
                        case 2:
                        {
                                SetCameraBehindPlayer(playerid);
                                PlayerInfo[playerid][pModel] = GetPlayerSkin(playerid);
                                TogglePlayerControllable(playerid, 1);
                                OnPlayerUpdate(playerid);//???????? ?? ????

                        }
                }
        }
        else if(GetPlayerMenu(playerid) == bich[1])
        {
                switch(row)
                {
                        case 0:
                        {
                                if(PlayerInfo[playerid][pSex] == 2)
                                {
                                        SkinPed[playerid]--;
                                        if(SkinPed[playerid] <= 0)
                                        {
                                                SkinPed[playerid] = 4;
                                        }
                                        SetPlayerSkin(playerid,SkinMen[SkinPed[playerid]]);
                                }
                                if(PlayerInfo[playerid][pSex] == 2)
                                {
                                        SkinPed[playerid]--;
                                        if(SkinPed[playerid] <= 0)
                                        {
                                                SkinPed[playerid] = 2;
                                        }
                                        SetPlayerSkin(playerid,SkinGirl[SkinPed[playerid]]);
                                }
                                ShowMenuForPlayer(bich[1],playerid);
                        }
                        case 1:
                        {
                                if(PlayerInfo[playerid][pSex] == 2)
                                {
                                        SkinPed[playerid]++;
                                        if(SkinPed[playerid] >= 5)
                                        {
                                                SkinPed[playerid] = 0;
                                        }
                                        SetPlayerSkin(playerid,SkinMen[SkinPed[playerid]]);
                                }
                                if(PlayerInfo[playerid][pSex] == 2)
                                {
                                        SkinPed[playerid]++;
                                        if(SkinPed[playerid] >= 3)
                                        {
                                                SkinPed[playerid] = 0;
                                        }
                                        SetPlayerSkin(playerid,SkinGirl[SkinPed[playerid]]);
                                }
                                ShowMenuForPlayer(bich[0],playerid);
                        }
                        case 2:
                        {
                                SetCameraBehindPlayer(playerid);
                                PlayerInfo[playerid][pModel] = GetPlayerSkin(playerid);
                                TogglePlayerControllable(playerid, 1);
                                OnPlayerUpdate(playerid);//???????? ?? ????
                        }
                }
        }
return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
	    case 1: //регистрация
	    {
			if(!response) return Kick(playerid);
			if(strlen(inputtext) < 4 || strlen(inputtext) > 16) return ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"Регистрация"
,"Длинна пароля от 4 до 16 символов!","Далее","Выйдти");
			format(PlayerInfo[playerid][pPass],17,inputtext);
			ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Укажите ваш пол:","{FFFFFF}","Мужской","Женский"
);
		}
		case 2: //Авторизация
		{
		    if(!response) return Kick(playerid);
		    if(!strlen(inputtext)) return ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Авторизация"
,"Введите пароль:","Войти","Выйдти");
			if(strcmp(PlayerInfo[playerid][pPass],inputtext,false) != 0) return ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Авторизация"
,"Введите пароль:","Войти","Выйдти");
			LoadPlayerAccount(playerid);
  		}
  		case 3: //Выбор пола
  		{
  		    if(response) PlayerInfo[playerid][pSex] = 2;
  		    else PlayerInfo[playerid][pSex] = 2;
  		    new str[35];
  		    format(str,sizeof(str),"users/%s.ini",PlayerInfo[playerid][
pName]);
  		    new openFile = ini_createFile(str);
			ini_setString(openFile,"Pass",PlayerInfo[playerid][pPass]
);
			ini_setInteger(openFile,"Sex",PlayerInfo[playerid][pSex]
);
			ini_closeFile(openFile);
   			SetPlayerPos(playerid,204.6633,-6.5563,1001.2109);
   			SetPlayerFacingAngle(playerid, 299.4084);
      		SetPlayerCameraPos(playerid,208.7765,-3.9595,1001.2178);
        	SetPlayerCameraLookAt(playerid,204.6633,-6.5563,1001.2109);
         	PlayerInfo[playerid][pSex] = 1;
          	SetPlayerSkin(playerid,SkinMen[0]);
           	ShowMenuForPlayer(bich[0], playerid);
           	TogglePlayerControllable(playerid, 0);
            SetPlayerInterior(playerid,5);
            SetPlayerPos(playerid,204.6633,-6.5563,1001.2109);
            SetPlayerFacingAngle(playerid, 299.4084);
            SetPlayerCameraPos(playerid,208.7765,-3.9595,1001.2178);
            SetPlayerCameraLookAt(playerid,204.6633,-6.5563,1001.2109);
            PlayerInfo[playerid][pSex] = 2;
            SetPlayerSkin(playerid,SkinGirl[0]);
            ShowMenuForPlayer(bich[0], playerid);
            TogglePlayerControllable(playerid, 0);
            SetPlayerInterior(playerid,5);
		}
	}
	return 1;
}

stock LoadPlayerAccount(playerid)
{
	new str[35];
	format(str,sizeof(str),"users/%s.ini",PlayerInfo[playerid][
pName]);
	new openFile = ini_openFile(str);
	ini_getInteger(openFile,"Sex",PlayerInfo[playerid][pSex]
);
	ini_closeFile(openFile);
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}

0

#2
Пользователь офлайн   FlixTco 

  • Прохожий
  • Вставить ник
  • Раскрыть информацию
UP
0

#3
Пользователь офлайн   Mario_Ferra 

  • Пользователь
  • Вставить ник
  • Раскрыть информацию
Одинаковые проверки на пол
Изображение
0

Поделиться темой:


Страница 1 из 1
  • Вы не можете создать новую тему
  • Вы не можете ответить в тему

1 человек читают эту тему
0 пользователей, 1 гостей, 0 скрытых пользователей


Яндекс.Метрика