Last active
August 29, 2015 14:23
-
-
Save continue98/22ab50cc8cef996aaeef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(strcmp(cmd, "/goto", true) == 0) | |
{ | |
tmp = strtok(cmdtext, idx); | |
if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playerid, COLOR_GRAD2, "Используй /goto [id игрока]"); | |
new plo = ReturnUser(tmp); | |
new | |
Float: x_player_pos, | |
Float: y_player_pos, | |
Float: z_player_pos, | |
interior = GetPlayerInterior(plo), | |
vehicleid_playerid = GetPlayerVehicleID(playerid), | |
vehicleid_plo = GetPlayerVehicleID(plo); | |
if(!IsPlayerConnected(plo) || PlayerInfo[playerid][pAdmin] < 3) return 0; | |
if(Logged[plo] == false) return SendClientMessage(playerid,COLOR_GRAD2, "Данный игрок не авторизован."); | |
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) | |
{ | |
if(interior > 0) return SendClientMessage(playerid,COLOR_GRAD2, "Игрок находиться в интерьере! Выйдите из машины и повторите попытку!"); | |
if(GetPlayerState(plo) == PLAYER_STATE_DRIVER || GetPlayerState(plo) == PLAYER_STATE_PASSENGER) | |
{ | |
GetVehiclePos(vehicleid_plo, x_player_pos, y_player_pos, z_player_pos); | |
} | |
else GetPlayerPos(plo, x_player_pos, y_player_pos, z_player_pos); | |
SetVehiclePos(vehicleid_playerid, x_player_pos, y_player_pos + 2, z_player_pos); | |
} | |
else | |
{ | |
GetPlayerPos(plo, x_player_pos, y_player_pos, z_player_pos); | |
SetPos(playerid, x_player_pos, y_player_pos + 2, z_player_pos); | |
SetPlayerInterior(playerid, interior); | |
if(interior == 0) intertest[playerid] = 0; | |
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(plo)); | |
} | |
GameTextForPlayer(playerid, "TELEPORT", 2000, 3); | |
new string_command_goto[43 + (MAX_PLAYER_NAME * 2) + 9]; | |
format(string_command_goto, sizeof(string_command_goto), "[A] %s[%d] телепортировался к игроку %s[%d]", PlayerInfo[playerid][pName], playerid, PlayerInfo[plo][pName], plo); | |
SendAdminMessage(COLOR_GRAD1, string_command_goto); | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment