Jump to content

Question

Posted

Problema intalnita (descriere):Salut sa-mp.ro, mam apucat să editez un pic comanda /goto și nu știu de ce nu funcționează perfect.
Ero(area / rile) / warning-(ul / urile):Nu am
Liniile de cod / sursa / script-ul(obligatoriu):

CMD:goto(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
	if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
	{
		new id, sendername[MAX_PLAYER_NAME], string[196], giveplayer[MAX_PLAYERS];
		if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFFFFFFFF, "{B8DBFF}Syntax: /goto <Name/Playerid>");
		{
			if(id != INVALID_PLAYER_ID)
	        {
				new Float:ax,Float:ay,Float:az;
				GetPlayerPos(playerid,ax,ay,az);
				posxxx[playerid] = ax;
				posyyy[playerid] = ay;
				poszzz[playerid] = az;
				new Float:x, Float:y, Float:z;
				GetPlayerPos(id, x, y, z);
				new tmpcar = GetPlayerVehicleID(playerid);
				if (GetPlayerState(playerid) == 2)
				{
					SetVehiclePos(tmpcar, x, y+4, z);
				}
				else
				{
					SetPlayerPos(playerid,x,y+2, z);
				}
				SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
				SetPlayerInterior(playerid, GetPlayerInterior(id));
				if(InHouse[id] > 0)
				{
					InHouse[playerid] = InHouse[id];
				}
				if(InHQ[id] > 0)
				{
					InHQ[playerid] = InHQ[id];
				}
				if(InBussines[id] > 0)
				{
					InBussines[playerid] = InBussines[id];
				}
					if(PlayerInfo[playerid][pAdmin] >= 1)
			        {
			            format(string, sizeof(string), "Teleport: {FFFFFF}Adminul %s s-a teleportat la tine.", sendername);
						SendClientMessage(id, COLOR_RED, string);
				    	format(string, 256, "{1FA81E}[AdmWarning]: {91A9C3}Adminul %s s-a teleportat la %s [{1FA81E}/goto{91A9C3}].", sendername, giveplayer);
						ABroadCast(COLOR_WHITE,string,5);
					}
					else if(PlayerInfo[playerid][pHelper] >= 1)
					{
					    format(string, sizeof(string), "Teleport: {FFFFFF}Helper-ul %s s-a teleportat la tine.", sendername);
						SendClientMessage(id, COLOR_RED, string);
						format(string, 256, "{1FA81E}[HWarning]: {91A9C3}Helper-ul %s s-a teleportat la %s [{1FA81E}/goto{91A9C3}].", sendername,giveplayer);
						ABroadCast(COLOR_WHITE,string,5);
					}
					return 1;
				}
				else
				{
					SendClientMessage(playerid, COLOR_WHITE, "{C90000}Info: {FFFFFF}Nu esti autorizat sa folosesti aceasta comanda!");
					return 1;
				}
			}
		}
		else
		{
		SendClientMessage(playerid, COLOR_WHITE, "{5CAD5C}Error: Your admin/helper level isn't high enough to use this command.");
	}
	return 1;
}


Imagini / Video (optional):http://imgur.com/dNvLm6U
Ati incercat sa rezolvati singur?:Da

2 answers to this question

Recommended Posts

  • 0
  • Administrator
Posted (edited)

Adauga

GetPlayerName(id, giveplayer, sizeof(giveplayer));

dupa

if(id != INVALID_PLAYER_ID)
{

 

Edited by WopsS
Guest
This topic is now closed to further replies.
×
×
  • 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.