Jump to content
  • 0

Lspec


Deejaybwg

Question

Trec direct la subiect:

Cand dau pe server comanda /lspec id (sa urmaresc un player) se inchide serverul :undecided:

Pana acum nu facea.. Acum de ieri a inceput sa faca asa.. Cand dau /lspec id se inchide serverul :undecided:

De la ce ar putea fi ? Si cum as putea sa rezolv ?

www.youtube.com/thebwgg

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

Comanda:

dcmd_lspec(playerid,params[])

{

if(AccInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid)){

if(!strlen(params) || !IsNumeric(params)) return SendClientMessage(playerid, red, "USAGE: /lspec [playerid]");

new specplayerid = strval(params);

if(AccInfo[specplayerid][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");

if(IsPlayerConnected(specplayerid) && specplayerid != INVALID_PLAYER_ID) {

if(specplayerid == playerid) return SendClientMessage(playerid, red, "ERROR: You cannot spectate yourself");

if(GetPlayerState(specplayerid) == PLAYER_STATE_SPECTATING && AccInfo[specplayerid][specID] != INVALID_PLAYER_ID) return SendClientMessage(playerid, red, "Spectate: Player spectating someone else");

if(GetPlayerState(specplayerid) != 1 && GetPlayerState(specplayerid) != 2 && GetPlayerState(specplayerid) != 3) return SendClientMessage(playerid, red, "Spectate: Player not spawned");

if( (AccInfo[specplayerid][Level] != ServerInfo[MaxAdminLevel]) || (AccInfo[specplayerid][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] == ServerInfo[MaxAdminLevel]) ) {

StartSpectate(playerid, specplayerid);

SendCommandToAdmins(playerid,"LSpec");

GetPlayerPos(playerid,Pos[playerid][0],Pos[playerid][1],Pos[playerid][2]);

GetPlayerFacingAngle(playerid,Pos[playerid][3]);

SendClientMessage(playerid,blue,"|- Spectating On -|");

return StartSpectate(playerid, specplayerid);

}

else return SendClientMessage(playerid,red,"ERROR: You cannot spectate the highest level admin");

}

else return ErrorMessages(playerid, 2);

}

else return ErrorMessages(playerid, 7);

}

www.youtube.com/thebwgg

Link to comment
Share on other sites

Try this :grin: :

dcmd_lspec(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 2 || IsPlayerAdmin(playerid))
	{
		if(AccInfo[playerid][pGps] != -1)
		return SendClientMessage(playerid, red, "ERROR: First Disable the Gps System! (/gps off)");

	    if(!strlen(params) || !IsNumeric(params)) return
		SendClientMessage(playerid, LIGHTBLUE2, "Usage: /lspec [PlayerID]") &&
		SendClientMessage(playerid, orange, "Function: Will spec a specified Player");

		new specplayerid = ReturnUser(params);
		if(AccInfo[specplayerid][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
		return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");

        if(IsPlayerConnected(specplayerid) && specplayerid != INVALID_PLAYER_ID)
		{
			if(specplayerid == playerid)
			return SendClientMessage(playerid, red, "ERROR: You cannot spectate Yourself");

			if(GetPlayerState(specplayerid) == PLAYER_STATE_SPECTATING && AccInfo[specplayerid][SpecID] != INVALID_PLAYER_ID)
			return SendClientMessage(playerid, red, "ERROR: Player spectating someone else");

			if(GetPlayerState(specplayerid) != 1 && GetPlayerState(specplayerid) != 2 && GetPlayerState(specplayerid) != 3)
			return SendClientMessage(playerid, red, "ERROR: Player not Spawned");

			if((AccInfo[specplayerid][Level] != ServerInfo[MaxAdminLevel]) || (AccInfo[specplayerid][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] == ServerInfo[MaxAdminLevel]))
			{
				GetPlayerPos(playerid,Pos[playerid][0],Pos[playerid][1],Pos[playerid][2]);
				GetPlayerFacingAngle(playerid,Pos[playerid][3]);
				SendCommandToAdmins(playerid,"LSpec");
				SendClientMessage(playerid,blue,"|- Spectating On -|");
			 	return StartSpectate(playerid, specplayerid);
			}
			else return SendClientMessage(playerid,red,"ERROR: You cannot spectate the highest level admin");
		}
		else return ErrorMessages(playerid, 2);
	}
	else return ErrorMessages(playerid, 7);
}

Fara reclama in semnatura!

Link to comment
Share on other sites

@SPEEDY multumesc !

Mai ma o problema: cand dau /viplist nu apare lista cu membrii VIP :undecided:

Comanda:

dcmd_viplist(playerid, params[])

{

  #pragma unused params

  new string[128];

  if(IsPlayerConnected(playerid))

  {

      for (new i = 0; i < MAX_PLAYERS; i++)

      {

        if(IsPlayerConnected(i))

        {

            if(AccInfo[playerid][pVip] >= 1)

            {

              format(string, sizeof(string),"Vip : {F81414}%s(%d)", PlayerName2(i), i);

              SendClientMessage(playerid, green, string);

                    //ShowPlayerDialog(playerid, ADMIN_LIST, DIALOG_STYLE_LIST,"Online Admins: (command unstable)", string, "Send PM", "Close");

            }

        }

      }

  }

  return 1;

}

Si mai are o problema: nu se vede decat un player care are VIP ceilalti nu se vad pe lista.. Asta e a2-a problema.

www.youtube.com/thebwgg

Link to comment
Share on other sites

Incearca asa:

dcmd_viplist(playerid, params[])
{
	#pragma unused params
	new string[128];
	if(IsPlayerConnected(playerid))
	{
		for (new i = 0; i < MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
				if(AccInfo[i][pVip] >= 1)
				{
					format(string, sizeof(string),"Vip : {F81414}%s(%d)", PlayerName2(i), i);
					SendClientMessage(playerid, green, string);
				}
			}
		}
	}
	return 1;
}
In loc de
if(AccInfo[i][pVip] >= 1)
pusesei
if(AccInfo[playerid][pVip] >= 1)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.