Доступ к архиву

Переход в группу "Пользователь"

300.00 ₽
Одноразовый платёж
Быстрый переход в группу "Пользователи", без надобности написания постов и ожидания.

Покупка дает возможность:
Быть полноправным участником форума
Нормальное копирование кода
Создавать темы
Скачивать файлы
Доступ к архиву Pawno-Info

Система слежения за игроком на textdraw

Статус
В этой теме нельзя размещать новые ответы.

maksimakalita

Новичок
Помогите пожалуйста писал систему слежения с этого портала

PHP:
CMD:sp(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1) return true; // Заменить на свой массив с данными игрока
    if(!strlen(params)) return SendClientMessage(playerid, 0xBEBEBEFF, "Используйте /sp [id]");
    new giveplayerid = strval(params);
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, 0xBEBEBEFF, "Игрок не авторизован!");
    if(giveplayerid == playerid) return SendClientMessage(playerid, 0xBEBEBEFF, "Вы не можете следить за собой!");
    startSpectrate(playerid, giveplayerid);
    return true;
}
PHP:
static const gun_name [ 18 ] [ ] =
{
    "9mm pistol","Silenced 9mm","Desert Eagle","Shotgun",
    "Sawnoff Shotgun","Combat Shotgun","Micro SMG/UZI",
    "MP5","AK-47","M4","Tec-9","Country Rifle","Sniper Rifle",
    "RPG","HS Rocket","Flamethrower","Minigun","Not defined"
};
stock startSpectrate(playerid, spec_id)
{
    new string[MAX_PLAYER_NAME + 63 + 14 + 9 + sizeof(gun_name) - 20],name[24];
    GetPlayerName(spec_id, name, sizeof(name));
    specPlayer[playerid][gun_id] = GetPlayerWeapon(spec_id);
    GetPlayerHealth(spec_id, specPlayer[playerid][specHP]);
    GetPlayerArmour(spec_id, specPlayer[playerid][specArmour]);
    specPlayer[playerid][ping] = GetPlayerPing(spec_id);
    specPlayer[playerid][ammo] = GetPlayerAmmo(spec_id);
    specPlayer[playerid][inCar] = (IsPlayerInAnyVehicle(spec_id)) ? true : false;
    
    /* Формат текстдрайвов */
    for(new i = 0; i <= 16; i++) TextDrawShowForPlayer(playerid, SpectrateTD[i]);
    format(string, sizeof(string), "%s (id %d)", name, spec_id);
    PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][0], string);

    format(string, sizeof(string), "Level - %d", GetPlayerScore(spec_id));
    PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][1], string);

    format(string, sizeof(string), "Skin - %d", GetPlayerSkin(spec_id));
    PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][2], string);

    format(string, sizeof(string), "Health - %.0f", specPlayer[playerid][specHP]);
    PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][3], string);

    format(string, sizeof(string), "Armour - %.0f", specPlayer[playerid][specArmour]);
    PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][4], string);

    format(string, sizeof(string), "InVehicle - %s",specPlayer[playerid][inCar] == true ? ("true") : ("false"));
    PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][5], string);

    format(string, sizeof(string), "Ping - %d", specPlayer[playerid][ping]);
    PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][6], string);

    format(string, sizeof(string), "%s", gun_name[specPlayer[playerid][gun_id]]);
    PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][7], string);
    
    format(string, sizeof(string), "Ammo - %d", specPlayer[playerid][ammo]);
    PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][8], string);
    
    for(new i = 0; i <= 9; i++) PlayerTextDrawShow(playerid, pSpectrateTD[playerid][i]);

     /* Сохранение позиции игрока */
    GetPlayerPos(playerid, specPlayer[playerid][sX], specPlayer[playerid][sY], specPlayer[playerid][sZ]);
    specPlayer[playerid][virtualWorld] = GetPlayerInterior(playerid);
    specPlayer[playerid][interior] = GetPlayerVirtualWorld(playerid);
    specPlayer[playerid][spectarete_id] = spec_id;

     /* Переводим игрока в режим наблюдения */
    TogglePlayerSpectating(playerid, true);
    PlayerSpectateVehicle(playerid, (specPlayer[playerid][inCar] == true ) ? GetPlayerVehicleID(spec_id) : spec_id, SPECTATE_MODE_NORMAL);
    specPlayer[playerid][timer] = SetTimerEx("spectrateTimer", 1000, true, "ii", playerid, spec_id);
    
    return true;
}

stock stopSpectrate(playerid)
{
    KillTimer(specPlayer[playerid][timer]);
    specPlayer[playerid][spectarete_id] = -1;
    TogglePlayerSpectating(playerid, false);
    for(new i = 0; i <= 9; i++) PlayerTextDrawHide(playerid, pSpectrateTD[playerid][i]);
    for(new i = 0; i <= 16; i++) TextDrawHideForPlayer(playerid, SpectrateTD[i]);
    
    /* Возвращение игрока на место ухода в /sp */
    SetPlayerPos(playerid, specPlayer[playerid][sX], specPlayer[playerid][sY], specPlayer[playerid][sZ]);
    SetPlayerInterior(playerid, specPlayer[playerid][interior]);
    SetPlayerVirtualWorld(playerid, specPlayer[playerid][virtualWorld]);
    return true;
}

@_spectrateTimer(playerid, spec_id);
@_spectrateTimer(playerid, spec_id)
{
    if(!IsPlayerConnected(spec_id)) return stopSpectrate(playerid);

    new string[63 + 14 + 9 + sizeof(gun_name) - 20];
    new Float: health, Float: Armour, bool: pInCar;
    pInCar = (IsPlayerInAnyVehicle(spec_id)) ? true : false;
    GetPlayerHealth(spec_id, health), GetPlayerArmour(spec_id, Armour);

    format(string, sizeof(string), "Level - %d", GetPlayerScore(spec_id));
    PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][1], string);

    format(string, sizeof(string), "Skin - %d", GetPlayerSkin(spec_id));
    PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][2], string);

    if(health != specPlayer[playerid][specHP])
    {
        specPlayer[playerid][specHP] = health;
        format(string, sizeof(string), "Health - %.0f", specPlayer[playerid][specHP]);
        PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][3], string);
    }
    if(Armour != specPlayer[playerid][specArmour])
    {
        specPlayer[playerid][specArmour] = Armour;
        format(string, sizeof(string), "Armour - %.0f", specPlayer[playerid][specArmour]);
        PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][4], string);
    }
    if(specPlayer[playerid][inCar] != pInCar)
    {
        specPlayer[playerid][inCar] = pInCar;
        PlayerSpectateVehicle(playerid, (specPlayer[playerid][inCar] == true ) ? GetPlayerVehicleID(spec_id) : spec_id, SPECTATE_MODE_NORMAL);
        
        format(string, sizeof(string), "InVehicle - %s",specPlayer[playerid][inCar] == true ? ("true") : ("false"));
        PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][5], string);
    }
    if(GetPlayerPing(spec_id) != specPlayer[playerid][ping])
    {
        specPlayer[playerid][ping] = GetPlayerPing(spec_id);
        format(string, sizeof(string), "Ping - %d", specPlayer[playerid][ping]);
        PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][6], string);
    }
    if(GetPlayerWeapon(spec_id) != specPlayer[playerid][gun_id])
    {
        specPlayer[playerid][gun_id] = GetPlayerWeapon(spec_id);
        format(string, sizeof(string), "%s", gun_name[specPlayer[playerid][gun_id]]);
        PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][7], string);
    }
    if(GetPlayerAmmo(spec_id) != specPlayer[playerid][ammo])
    {
        specPlayer[playerid][ammo] = GetPlayerAmmo(spec_id);
        format(string, sizeof(string), "Ammo - %d", specPlayer[playerid][ammo]);
        PlayerTextDrawSetString(playerid, pSpectrateTD[playerid][8], string);
    }
    return true;
}

stock spectrateTextdrawsLoad()
{
    SpectrateTD[0] = TextDrawCreate(497.555480, 107.066703, "box");
    TextDrawLetterSize(SpectrateTD[0], 0.000000, 30.333816);
    TextDrawTextSize(SpectrateTD[0], 631.000000, 0.000000);
    TextDrawAlignment(SpectrateTD[0], 1);
    TextDrawColor(SpectrateTD[0], -1);
    TextDrawUseBox(SpectrateTD[0], 1);
    TextDrawBoxColor(SpectrateTD[0], 157);
    TextDrawSetShadow(SpectrateTD[0], 0);
    TextDrawSetOutline(SpectrateTD[0], 0);
    TextDrawBackgroundColor(SpectrateTD[0], 23);
    TextDrawFont(SpectrateTD[0], 1);
    TextDrawSetProportional(SpectrateTD[0], 1);
    TextDrawSetShadow(SpectrateTD[0], 0);

    SpectrateTD[1] = TextDrawCreate(537.847839, 104.833335, "Spectate~n~");
    TextDrawLetterSize(SpectrateTD[1], 0.356427, 1.325832);
    TextDrawAlignment(SpectrateTD[1], 1);
    TextDrawColor(SpectrateTD[1], -1);
    TextDrawSetShadow(SpectrateTD[1], 194);
    TextDrawSetOutline(SpectrateTD[1], -1);
    TextDrawBackgroundColor(SpectrateTD[1], 255);
    TextDrawFont(SpectrateTD[1], 1);
    TextDrawSetProportional(SpectrateTD[1], 1);
    TextDrawSetShadow(SpectrateTD[1], 194);

    SpectrateTD[2] = TextDrawCreate(497.423645, 107.066688, "box");
    TextDrawLetterSize(SpectrateTD[2], 0.000000, 1.095798);
    TextDrawTextSize(SpectrateTD[2], 631.000000, 0.000000);
    TextDrawBoxColor(SpectrateTD[2], 14549147);

    SpectrateTD[3] = TextDrawCreate(497.254608, 140.233474, "box");
    TextDrawLetterSize(SpectrateTD[3], 0.000000, -0.448020);
    TextDrawTextSize(SpectrateTD[3], 631.000244, 0.000000);
    TextDrawBoxColor(SpectrateTD[3], 10879231);

    SpectrateTD[4] = TextDrawCreate(497.254608, 301.743316, "box");
    TextDrawLetterSize(SpectrateTD[4], 0.000000, -0.448020);
    TextDrawTextSize(SpectrateTD[4], 631.000244, 0.000000);
    TextDrawBoxColor(SpectrateTD[4], 10879231);
    for(new s = 2; s < 5; s++)
    {
        TextDrawAlignment(SpectrateTD[s], 1);
        TextDrawColor(SpectrateTD[s], -1);
        TextDrawUseBox(SpectrateTD[s], 1);
        TextDrawSetShadow(SpectrateTD[s], 0);
        TextDrawSetOutline(SpectrateTD[s], 0);
        TextDrawBackgroundColor(SpectrateTD[s], 255);
        TextDrawFont(SpectrateTD[s], 1);
        TextDrawSetProportional(SpectrateTD[s], 1);
        TextDrawSetShadow(SpectrateTD[s], 0);
    }
    SpectrateTD[5] = TextDrawCreate(499.260711, 329.416534, "LD_SPAC:white");
    SpectrateTD[6] = TextDrawCreate(565.800292, 329.316497, "LD_SPAC:white");
    SpectrateTD[7] = TextDrawCreate(565.800292, 303.649810, "LD_SPAC:white");
    for(new s = 5; s < 8; s++)
    {
        TextDrawLetterSize(SpectrateTD[s], 0.000000, 0.000000);
        TextDrawTextSize(SpectrateTD[s], 62.000000, 22.000000);
        TextDrawAlignment(SpectrateTD[s], 1);
        TextDrawColor(SpectrateTD[s], 9437439);
        TextDrawSetShadow(SpectrateTD[s], 0);
        TextDrawSetOutline(SpectrateTD[s], 0);
        TextDrawBackgroundColor(SpectrateTD[s], 255);
        TextDrawFont(SpectrateTD[s], 4);
        TextDrawSetProportional(SpectrateTD[s], 0);
        TextDrawSetShadow(SpectrateTD[s], 0);
        TextDrawSetSelectable(SpectrateTD[s], true);
    }
    SpectrateTD[8] = TextDrawCreate(499.270111, 303.649871, "LD_SPAC:white");
    TextDrawTextSize(SpectrateTD[8], 62.000000, 22.000000);

    SpectrateTD[9] = TextDrawCreate(499.738555, 354.983215, "LD_SPAC:white");
    TextDrawTextSize(SpectrateTD[9], 128.000000, 22.000000);
    for(new s = 8; s < 10; s++)
    {
        TextDrawLetterSize(SpectrateTD[s], 0.000000, 0.000000);
        TextDrawAlignment(SpectrateTD[s], 1);
        TextDrawColor(SpectrateTD[s], 9437439);
        TextDrawSetShadow(SpectrateTD[s], 0);
        TextDrawSetOutline(SpectrateTD[s], 0);
        TextDrawBackgroundColor(SpectrateTD[s], 255);
        TextDrawFont(SpectrateTD[s], 4);
        TextDrawSetProportional(SpectrateTD[s], 0);
        TextDrawSetShadow(SpectrateTD[s], 0);
        TextDrawSetSelectable(SpectrateTD[s], true);
    }
    SpectrateTD[10] = TextDrawCreate(554.631774, 360.310943, "Exit~n~");
    SpectrateTD[11] = TextDrawCreate(553.711486, 240.554992, "Gun~n~");
    for(new s = 10; s < 12; s++)
    {
        TextDrawLetterSize(SpectrateTD[s], 0.324566, 1.401664);
        TextDrawAlignment(SpectrateTD[s], 1);
        TextDrawColor(SpectrateTD[s], -1);
        TextDrawSetShadow(SpectrateTD[s], 194);
        TextDrawSetOutline(SpectrateTD[s], -1);
        TextDrawBackgroundColor(SpectrateTD[s], 255);
        TextDrawFont(SpectrateTD[s], 1);
        TextDrawSetProportional(SpectrateTD[s], 1);
        TextDrawSetShadow(SpectrateTD[s], 194);
    }
    SpectrateTD[12] = TextDrawCreate(497.391662, 239.350265, "box");
    TextDrawLetterSize(SpectrateTD[12], 0.000000, -0.448020);
    TextDrawTextSize(SpectrateTD[12], 630.701660, 0.000000);
    TextDrawAlignment(SpectrateTD[12], 1);
    TextDrawColor(SpectrateTD[12], -1);
    TextDrawUseBox(SpectrateTD[12], 1);
    TextDrawBoxColor(SpectrateTD[12], 10879231);
    TextDrawSetShadow(SpectrateTD[12], 0);
    TextDrawSetOutline(SpectrateTD[12], 0);
    TextDrawBackgroundColor(SpectrateTD[12], 255);
    TextDrawFont(SpectrateTD[12], 1);
    TextDrawSetProportional(SpectrateTD[12], 1);
    TextDrawSetShadow(SpectrateTD[12], 0);

    SpectrateTD[13] = TextDrawCreate(518.720031, 307.642395, "Kick~n~");
    SpectrateTD[14] = TextDrawCreate(586.203552, 307.891876, "Stats~n~");
    SpectrateTD[15] = TextDrawCreate(520.619567, 333.243957, "Ban~n~");
    SpectrateTD[16] = TextDrawCreate(585.503723, 335.577301, "Warn~n~");
    for(new s = 13; s < 17; s++)
    {
        TextDrawLetterSize(SpectrateTD[s], 0.324566, 1.401664);
        TextDrawAlignment(SpectrateTD[s], 1);
        TextDrawColor(SpectrateTD[s], -1);
        TextDrawSetShadow(SpectrateTD[s], 194);
        TextDrawSetOutline(SpectrateTD[s], -1);
        TextDrawBackgroundColor(SpectrateTD[s], 255);
        TextDrawFont(SpectrateTD[s], 1);
        TextDrawSetProportional(SpectrateTD[s], 1);
        TextDrawSetShadow(SpectrateTD[s], 194);
    }
    return true;
}

stock spectratePlayerTextdrawsLoad(playerid)
{
    pSpectrateTD[playerid][0] = CreatePlayerTextDraw(playerid, 515.358642, 121.749977, "Dante_Rivero_(id_81)");
    pSpectrateTD[playerid][1] = CreatePlayerTextDraw(playerid, 502.707977, 145.666763, "Level_-_12");
    pSpectrateTD[playerid][2] = CreatePlayerTextDraw(playerid, 569.179382, 146.250061, "Skin_-_87");
    pSpectrateTD[playerid][3] = CreatePlayerTextDraw(playerid, 524.467712, 164.267898, "Health_-_100.0");
    pSpectrateTD[playerid][4] = CreatePlayerTextDraw(playerid, 524.967590, 180.552185, "Armour_-_0.0");
    pSpectrateTD[playerid][5] = CreatePlayerTextDraw(playerid, 520.519592, 197.252349, "InVehicle_-_false~n~");
    pSpectrateTD[playerid][6] = CreatePlayerTextDraw(playerid, 536.668884, 214.785705, "Ping_-_112");
    pSpectrateTD[playerid][7] = CreatePlayerTextDraw(playerid, 501.521026, 257.055999, "Desert_Eagle_(id_24)");
    pSpectrateTD[playerid][8] = CreatePlayerTextDraw(playerid, 501.321014, 275.440429, "Ammo_-_54");
    for(new s = 0; s < 9; s++)
    {
        PlayerTextDrawLetterSize(playerid, pSpectrateTD[playerid][s], 0.324566, 1.401664);
        PlayerTextDrawAlignment(playerid, pSpectrateTD[playerid][s], 1);
        PlayerTextDrawColor(playerid, pSpectrateTD[playerid][s], -1);
        PlayerTextDrawSetShadow(playerid, pSpectrateTD[playerid][s], 194);
        PlayerTextDrawSetOutline(playerid, pSpectrateTD[playerid][s], -1);
        PlayerTextDrawBackgroundColor(playerid, pSpectrateTD[playerid][s], 255);
        PlayerTextDrawFont(playerid, pSpectrateTD[playerid][s], 1);
        PlayerTextDrawSetProportional(playerid, pSpectrateTD[playerid][s], 1);
        PlayerTextDrawSetShadow(playerid, pSpectrateTD[playerid][s], 194);
    }
    return true;
}
Выдает ошибку
PHP:
C:\Users\Admin\Desktop\Dm Project\gamemodes\Dm.pwn(5810) : error 017: undefined symbol "specPlayer"
C:\Users\Admin\Desktop\Dm Project\gamemodes\Dm.pwn(5810) : warning 215: expression has no effect
C:\Users\Admin\Desktop\Dm Project\gamemodes\Dm.pwn(5810) : error 001: expected token: ";", but found "]"
C:\Users\Admin\Desktop\Dm Project\gamemodes\Dm.pwn(5810) : error 029: invalid expression, assumed zero
C:\Users\Admin\Desktop\Dm Project\gamemodes\Dm.pwn(5810) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу