Hey guys, can someone help me, If I /setscore, or /goto, it goes to one player, and there names is Carl.
Код:
COMMAND:goto(playerid, params[])
{
// Setup local variables
new OtherPlayer, Float:x, Float:y, Float:z, PortMsg[128], IntID, WorldID;
// Send the command to all admins so they can see it
SendAdminText(playerid, "/goto", 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, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/port <OtherPlayer>\"");
else
{
// Check if that other player is online
if (IsPlayerConnected(OtherPlayer))
{
// Get the location of the other player
GetPlayerPos(OtherPlayer, x, y, z);
IntID = GetPlayerInterior(OtherPlayer);
WorldID = GetPlayerVirtualWorld(OtherPlayer);
// Port the player to the given location
SetPlayerVirtualWorld(playerid, WorldID);
SetPlayerInterior(playerid, IntID);
SetPlayerPos(playerid, x, y, z + 3.0);
// Let the player know about it
format(PortMsg, 128, "You have been ported to location: %4.2f, %4.2f, %4.2f", x, y, z + 3.0);
SendClientMessage(playerid, 0x00FF00FF, PortMsg);
}
else
SendClientMessage(playerid, 0xFF0000FF, "That player isn't online");
}
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You cannot use /port when you're in jail");
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You cannot use /port when you're wanted");
}
else
return 0;
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
EDIT: It happens on every command I.E: /setlevel, /setcash, /sethealth blah blah blah.