Jump to content
  • 0

Port Location


Pinki950

Question

Nick: Pinki950

Problema: Cum as putea pune la comanda de mai jos si Interiorul  (X, Y, Z, Interior-ID)

[pawn]COMMAND:portloc(playerid, params[])

{

// Setup local variables

new Float:x, Float:y, Float:z, PortMsg[128];

// Send the command to all admins so they can see it

SendAdminText(playerid, "/portloc", params);

// Check if the player has logged in

if (APlayerData[playerid][LoggedIn] == true)

{

// Check if the player's admin-level is at least 1

if (APlayerData[playerid][PlayerLevel] >= 1)

{

// Check if the player has a wanted level of less than 3

if (GetPlayerWantedLevel(playerid) < 3)

{

// Check if the player is not jailed

if (APlayerData[playerid][PlayerJailed] == 0)

{

if (sscanf(params, "fff", x, y, z)) SendClientMessage(playerid, 0xFF0000AA, "Ex: \"/portloc <x> <y> <z>\"");

else

{

// Port the player to the given location

SetPlayerPos(playerid, x, y, z);

// Let the player know about it

format(PortMsg, 128, "Te-ai teleportat la locatia: %4.2f, %4.2f, %4.2f", x, y, z);

SendClientMessage(playerid, 0x00FF00FF, PortMsg);

}

}

else

    SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nu poti utiliza /portloc at cand esti in inchisoare");

}

else

    SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nu poti utiliza /portloc at cand esti urmarit");

}

else

    return 0;

}

else

    return 0;

// Let the server know that this was a valid command

return 1;

}[/pawn]

?q=192&s=s&bg1=5eeb06&bg2=3a7bfc&t=000&gl=fff&b=000000&gbg=000
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

COMMAND:portloc(playerid, params[])
{
	// Setup local variables
	new Float:x, Float:y, Float:z, PortMsg[128],interior;

	// Send the command to all admins so they can see it
	SendAdminText(playerid, "/portloc", params);

	// Check if the player has logged in
	if (APlayerData[playerid][LoggedIn] == true)
	{
		// Check if the player's admin-level is at least 1
		if (APlayerData[playerid][PlayerLevel] >= 1)
		{
			// Check if the player has a wanted level of less than 3
			if (GetPlayerWantedLevel(playerid) < 3)
			{
				// Check if the player is not jailed
				if (APlayerData[playerid][PlayerJailed] == 0)
				{
					if (sscanf(params, "fffi", x, y, z , interior)) SendClientMessage(playerid, 0xFF0000AA, "Ex: \"/portloc <x> <y> <z> <int>"");
					else
					{
						// Port the player to the given location
						SetPlayerPos(playerid, x, y, z);
						SetPlayerInterior(playerid,interior);
						// Let the player know about it
						format(PortMsg, 128, "Te-ai teleportat la locatia: %4.2f, %4.2f, %4.2f", x, y, z);
						SendClientMessage(playerid, 0x00FF00FF, PortMsg);
					}
				}
				else
				    SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nu poti utiliza /portloc at cand esti in inchisoare");
			}
			else
			    SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nu poti utiliza /portloc at cand esti urmarit");
		}
		else
		    return 0;
	}
	else
	    return 0;

	// Let the server know that this was a valid command
	return 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.