31.12.2013, 19:13
Alguem pode me ajudar meu comando /espiar e /ir apartir do id 8 quando eu do ex: /ir 8 ele vai no id 0 mesma coisa com /espiar
COMANDOS:
COMANDOS:
Quote:
COMMAND:espiar(playerid, params[]) { // Setup local variables new OtherPlayer, Name[24], Msg[128]; // Send the command to all admins so they can see it SendAdminText(playerid, "/espiar", 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) { if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /espiar [id]"); else { // Check if that other player is online if (IsPlayerConnected(OtherPlayer)) { // Get the player's name GetPlayerName(OtherPlayer, Name, sizeof(Name)); // Turn spectating on TogglePlayerSpectating(playerid, 1); // Check if the other player is driving a vehicle if (GetPlayerVehicleSeat(OtherPlayer) == -1) { // The other player is on foot, so spectate him PlayerSpectatePlayer(playerid, OtherPlayer); SetPlayerInterior(playerid, GetPlayerInterior(OtherPlayer)); APlayerData[playerid][SpectateID] = OtherPlayer; APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_PLAYER; } else { // The other player is in a vehicle, so spectate the vehicle PlayerSpectateVehicle(playerid, GetPlayerVehicleID(OtherPlayer)); APlayerData[playerid][SpectateID] = OtherPlayer; APlayerData[playerid][SpectateVehicle] = GetPlayerVehicleID(OtherPlayer); APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_VEHICLE; } format(Msg, 128, "{00FF00}[MDC] Vocк estб espiando {FFFF00}%s.", Name); SendClientMessage(playerid, 0xFFFFFFFF, Msg); } else SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[MDC] Esse jogador nгo estб online."); } } else return 0; } else return 0; // Let the server know that this was a valid command return 1; } |
Quote:
COMMAND:ir(playerid, params[]) { // Setup local variables new OtherPlayer, Float, Float:y, Float:z, PortMsg[128], IntID, WorldID; // Send the command to all admins so they can see it SendAdminText(playerid, "/ir", 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, "Use: /ir [id]"); 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, "[MDC] A posiзгo do jogador й: %4.2f, %4.2f, %4.2f", x, y, z + 3.0); SendClientMessage(playerid, 0x00FF00FF, PortMsg); } else SendClientMessage(playerid, 0xFF0000FF, "[MDC] Esse jogador nгo estб online."); } } else SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[MDC] Vocк nгo pode usar o comando /ir quando preso."); } else SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[MDC] Vocк nao pode usar o comando /ir quando procurado."); } else return 0; } else return 0; // Let the server know that this was a valid command return 1; } |