Рекомендованные сообщения



Не найдено.

9 posts in this topic

Код команды specoff

cmd:specoff(playerid, params[])
{
	if(PI[playerid][pAdmin] < ADM_MODER) return 1;
	else if(AdminLogged[playerid] == false) return SendClientMessage(playerid, COLOR_GREY, YouAreNotLoggedInAsAdmin);
	else if(PI[playerid][Spectating][0] == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, ""cER"Вы не наблюдаете за игроком!");
	if(PI[playerid][pAdmin] < 5)
	{
		new string[128];
		format(string, sizeof(string), ""aAC"%s[%d] закончил наблюдение за %s[%i]", GetName(playerid), playerid, GetName(PI[playerid][Spectating][0]), PI[playerid][Spectating][0]);
	    SendAdminMessage(COLOR_GREY, string);
  	}
	TogglePlayerSpectating(playerid, 0);
    PlayerTextDrawHide(playerid, PI[playerid][SpecTxt]);
	PlayerTextDrawDestroy(playerid, PI[playerid][SpecTxt]);
	return HideMenuForPlayer(specmenu, playerid);
}

Код команды spec

cmd:spec(playerid, params[])
{
	if(PI[playerid][pAdmin] < ADM_MODER) return 1;
	else if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "В транспорте нельзя следить!");
	else if(AdminLogged[playerid] == false) return SendClientMessage(playerid, COLOR_GREY, YouAreNotLoggedInAsAdmin);
	else if(sscanf(params, "u", params[0])) return SendClientMessage(playerid, COLOR_WHITE, ""cPS"{9ACD32}Введите: {FFFFFF} /spec [id игрока]");
	else if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, COLOR_GREY, PlayerIsNotOnline);
	else if(PlayerLogged[params[0]] == false) return SendClientMessage(playerid, COLOR_GREY, PlayerIsNotAuthorized);
	else if(PI[playerid][pAdmin] < ADM_GRAND_ADMIN && AdminInfo[params[0]][admSpectate]) return SendClientMessage(playerid, COLOR_GREY, ""cER"Следить за этим администратором запрещено");
	//else if(GetString(GetName(playerid), NGA1)) return SendClientMessage(playerid, COLOR_GREY, ""cER"Следить за этим администратором запрещено");
 	new Float:xPos[4];
	GetPlayerPos(playerid, xPos[0], xPos[1], xPos[2]);
	GetPlayerFacingAngle(playerid, xPos[3]);
	if(PI[playerid][Spectating][0] == INVALID_PLAYER_ID)
	{
	    SetPVarInt(playerid, "SpecInt", GetPlayerInterior(playerid));
		SetPVarInt(playerid, "SpecVw", GetPlayerVirtualWorld(playerid));
		SetPVarFloat(playerid, "SpecX", xPos[0]);
		SetPVarFloat(playerid, "SpecY", xPos[1]);
		SetPVarFloat(playerid, "SpecZ", xPos[2]);
		SetPVarFloat(playerid, "SpecA", xPos[3]);
		if(PI[playerid][pAdmin] < 5)
		{
			new string[128];
			format(string, sizeof(string), ""aAC"%s[%d] начал наблюдать за %s[%d]", GetName(playerid), playerid, GetName(params[0]), params[0]);
    		SendAdminMessage(COLOR_GREY, string);
   }
	}
	SetPlayerInterior(playerid, GetPlayerInterior(params[0]));
	SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(params[0]));
	TogglePlayerSpectating(playerid, 1);
	if(IsPlayerInAnyVehicle(params[0])) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(params[0]));
	else PlayerSpectatePlayer(playerid, params[0]);
	PI[playerid][Spectating][0] = params[0];
	PI[playerid][Spectating][1] = playerid;
	PlayerTextDrawDestroy(playerid, PI[playerid][SpecTxt]);
	PI[playerid][SpecTxt] = CreatePlayerTextDraw(playerid, 496.000000, 219.625000, "Spectate");
	PlayerTextDrawBackgroundColor(playerid, PI[playerid][SpecTxt], 255);
	PlayerTextDrawFont(playerid, PI[playerid][SpecTxt], 2);
	PlayerTextDrawLetterSize(playerid, PI[playerid][SpecTxt], 0.240000, 1.271875);
	PlayerTextDrawColor(playerid, PI[playerid][SpecTxt], -1);
	PlayerTextDrawSetOutline(playerid, PI[playerid][SpecTxt], 1);
	PlayerTextDrawShow(playerid, PI[playerid][SpecTxt]);
	return ShowMenuForPlayer(specmenu, playerid);
}

Ошибка:
 

C:\Users\Даниил\Desktop\Excellent RP\gamemodes\JRP.pwn(24682) : error 035: argument type mismatch (argument 1)
C:\Users\Даниил\Desktop\Excellent RP\gamemodes\JRP.pwn(24700) : error 035: argument type mismatch (argument 1)

Строка 24682
 

	return ShowMenuForPlayer(specmenu, playerid);

Строка 24700

	return ShowMenuForPlayer(specmenu, playerid);

 

Share this post


Link to post
Share on other sites

@⇜♛₮ℝĪτǿℕ♛⇝, функцию ShowMenuForPlayer покажите.

Share this post


Link to post
Share on other sites

@odosenok Если не ошибаюсь, то это

        //ShowMenuForPlayer(skinmenu, playerid);
        PlayerTextDrawShow(playerid, SelSkin[playerid]);
        if(PI[playerid][pSex] == 1) format(str, 7, "%d", JoinRegM[SelectCharPlace[playerid]]);
        else format(str, 7, "%d", JoinRegF[SelectCharPlace[playerid]]);
        for(new i; i < 38; i++) TextDrawShowForPlayer(playerid, SELECT_SKIN[i]);
		PlayerTextDrawSetString(playerid, SelSkin[playerid], str);
		SelectTextDraw(playerid, 0xFF4040AA);
		SetHealth(playerid, 100.0);
		if(PI[playerid][pSex] == 1) SetPlayerSkin(playerid, JoinRegM[SelectCharPlace[playerid]]), ChosenSkin[playerid] = JoinRegM[0];
		else SetPlayerSkin(playerid, JoinRegF[SelectCharPlace[playerid]]), ChosenSkin[playerid] = JoinRegF[0];
	}

 

Share this post


Link to post
Share on other sites

@⇜♛₮ℝĪτǿℕ♛⇝, не-не, не это.

Share this post


Link to post
Share on other sites

@odosenok Сори если туплю, целый день уже заказы выполняю, да и виндовс мозги етил)) 

public OnPlayerSelectedMenuRow(playerid, row)
{
    if(GetPlayerMenu(playerid) == Menu:INVALID_MENU) return SKick(playerid, 7436);
    if(GetPlayerMenu(playerid) == specmenu)
    {
        switch(row)
        {
            case 0:
            {
	            SetPlayerInterior(playerid,GetPlayerInterior(PI[playerid][Spectating][0]));
	            SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(PI[playerid][Spectating][0]));
	            TogglePlayerSpectating(playerid, 1);
	            if(IsPlayerInAnyVehicle(PI[playerid][Spectating][0]))
	            {
		           new carid = GetPlayerVehicleID(PI[playerid][Spectating][0]);
		           PlayerSpectateVehicle(playerid, carid);
             	}
	            else PlayerSpectatePlayer(playerid, PI[playerid][Spectating][0]);
                ShowMenuForPlayer(specmenu, playerid);

 

Share this post


Link to post
Share on other sites

@⇜♛₮ℝĪτǿℕ♛⇝, тьфу блин, я тупанул. Переменная specmenu как объявлена?

Share this post


Link to post
Share on other sites

@odosenok Нашел что то на подобие 
 

public OnPlayerSelectedMenuRow(playerid, row)
{
    if(GetPlayerMenu(playerid) == Menu:INVALID_MENU) return SKick(playerid, 7436);
    if(GetPlayerMenu(playerid) == specmenu)
    {
        switch(row)
        {
            case 0:
            {
	            SetPlayerInterior(playerid,GetPlayerInterior(PI[playerid][Spectating][0]));
	            SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(PI[playerid][Spectating][0]));
	            TogglePlayerSpectating(playerid, 1);
	            if(IsPlayerInAnyVehicle(PI[playerid][Spectating][0]))
	            {
		           new carid = GetPlayerVehicleID(PI[playerid][Spectating][0]);
		           PlayerSpectateVehicle(playerid, carid);
             	}
	            else PlayerSpectatePlayer(playerid, PI[playerid][Spectating][0]);
                ShowMenuForPlayer(specmenu, playerid);
            }
            case 1:
			{
			    new maxplayers = GetMaxPlayers();
				for(new id = PI[playerid][Spectating][0]+1, bool:secondloop; id < maxplayers; id++)
				{
				    if(id == maxplayers && !secondloop)
					{
						secondloop = true, id = 0;
						continue;
					}
					if(PlayerLogged[id] == false) continue;
					switch(GetPlayerState(id))
					{
						case 1..3: {}
						default: continue;
					}
					new param_str[4];
					format(param_str, sizeof param_str, "%i", id);
					callcmd::spec(playerid, param_str);
					break;
				}
				ShowMenuForPlayer(specmenu, playerid);
			}
            case 2:
			{
			    new maxplayers = GetMaxPlayers();
				for(new id = PI[playerid][Spectating][0]-1, bool:secondloop; id >= 0; id--)
				{
				    if(id <= 0 && !secondloop)
					{
						secondloop = true, id = maxplayers;
						continue;
					}
					if(PlayerLogged[id] == false) continue;
					switch(GetPlayerState(id))
					{
						case 1..3: {}
						default: continue;
					}
					new param_str[4];
					format(param_str, sizeof param_str, "%i", id);
					callcmd::spec(playerid, param_str);
					break;
				}
				ShowMenuForPlayer(specmenu, playerid);
			}
            case 3:
            {
                new param_str[11];
                format(param_str, sizeof(param_str), "%i", PI[playerid][Spectating][0]);
                callcmd::slap(playerid, param_str);
                ShowMenuForPlayer(specmenu, playerid);
            }
            case 4:
            {
                new param_str[11];
                format(param_str, sizeof(param_str), "%i", PI[playerid][Spectating][0]);
                callcmd::gm(playerid, param_str);
                ShowMenuForPlayer(specmenu, playerid);
            }
            case 5:
			{
				ShowPlayerStatsDialog(playerid, PI[playerid][Spectating][0]);
				ShowMenuForPlayer(specmenu, playerid);
			}
            case 6: callcmd::specoff(playerid, "");
		}
    }

 

2 минуты назад, odosenok сказал:

@⇜♛₮ℝĪτǿℕ♛⇝, тьфу блин, я тупанул. Переменная specmenu как объявлена?

new Menu:specmenu[MAX_PLAYERS][47];

 

Share this post


Link to post
Share on other sites

@⇜♛₮ℝĪτǿℕ♛⇝, попробуйте тогда строку с ошибкой менять на эту:

return ShowMenuForPlayer(specmenu[playerid], playerid);

 

Share this post


Link to post
Share on other sites

@odosenok толку ноль

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Романтик228
      By Романтик228
      можно играть как и в мобаил так и на пк.Есть охота, семейный отель, рейтинг семьи, крафты,бд идёт вместе с модом,фракции и банды все присутствует в моде. 
    • Романтик228
      By Романтик228


      Просмотр файла Мод samp
      можно играть как и в мобаил так и на пк.Есть охота, семейный отель, рейтинг семьи, крафты,бд идёт вместе с модом,фракции и банды все присутствует в моде. 
      Добавил Романтик228 Добавлено 20.10.2021 Категория Моды Автор Roman  
    • danko
      By danko
      Выдает вот такую ошибку и всё по нулям, базу нормально установил