Szerző Téma: FCNPC god mod bug?  (Megtekintve 645 alkalommal)

FCNPC god mod bug?
« Dátum: 2016. Augusztus 16. - 11:34:55 »
0 Show voters
Hello.  :)
Tudnátok nekem segíteni?
Éppen csinálom a DayZ es szerverem FCNPC zombikkal.
A lényeg , valami történt és a FCNPC zombik nem sebződnek, tehát olyan mintha GOD modjuk lenne, pedig nincs.
Az életük 200 ra beaáálítva.
Ha kéne az egész szerver: https://www.dropbox.com/s/dsde4zqs94pkj36/samp.rar?dl=0
 

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
//#include <geolocation>
#include <zcmd>
#include <sscanf2>
#include <a_npc>
#include <foreach>
#include <a_players>
#include <FCNPC>
#include <fixchars>
#include <a_players>
#include <toribio>
#include <MapAndreas>
//#include <YSI\\y_ini>
//#include <YSI\\y_timers>
//new zname[24];
//new zombie_count;
//new zombie[MAX_PLAYERS];
new MAX_ZOMBIES = 50;
//new playerVehicle[MAX_PLAYERS];
//static Float:pPos[3];
//new pID2;
//new Bar:hungerbar;
//new hunger1 = 100;
//new Bar:waterbar;
//new water1 = 100;
 
#define pLoop()       for(new i = 0, j = GetMaxPlayers(); i < j; i++) if(IsPlayerConnected(i))
forward Float:frandom(Float:max, Float:min = 0.0, dp = 4);
forward FCNPC_DoRespawn(npcid);
new Text:Textdraw0;
new Text:Textdraw1;
//--------------------------------------------------------------------------------------------------//
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Blank Filterscript by your name here\");
print(\"--------------------------------------\\n\");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print(\"\\n----------------------------------\");
print(\" Blank Gamemode by your name here\");
print(\"----------------------------------\\n\");
}
#endif
public OnGameModeInit()
{
    ZombieInit();
//SetTimer(\"anticheat\", 1000, 1);
//hungerbar = CreateProgressBar(548.00, 38.00, 57.50, 3.20, -1466871297, 100.0);
    //waterbar = CreateProgressBar(548.00, 48.00, 57.50, 3.20, 1518916095, 100.0);
//new Float:x, Float:y, Float:z;
//new Random = random(sizeof(ZSpawns));
//new randzspawn = random(30);
//new Rnd2 = random(sizeof(Spawns));
// Don\'t use these lines if it\'s a filterscript
SetGameModeText(\"MultiGames v1\");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
//SetTimer(\"ellenor\", 4000, true);
//---------------------------------------------------------------------------------------------//
/*Textdraw0 = TextDrawCreate(491.999938, 332.266632, \"ÉHSÉG 100/100\");
TextDrawLetterSize(Textdraw0, 0.449999, 1.600000);
TextDrawAlignment(Textdraw0, 1);
TextDrawColor(Textdraw0, -1523963137);
TextDrawSetShadow(Textdraw0, 0);
TextDrawSetOutline(Textdraw0, 1);
TextDrawBackgroundColor(Textdraw0, 51);
TextDrawFont(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);*/
//---------------------------------------------------------------------------------------------//
/*Textdraw1 = TextDrawCreate(498.400085, 350.186645, \"VÍZ  100/100\");
TextDrawLetterSize(Textdraw1, 0.449999, 1.600000);
TextDrawAlignment(Textdraw1, 1);
TextDrawColor(Textdraw1, 65535);
TextDrawSetShadow(Textdraw1, 0);
TextDrawSetOutline(Textdraw1, 1);
TextDrawBackgroundColor(Textdraw1, 51);
TextDrawFont(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);*/
    //---------------------------------------------------------------------------------------------//
    //SetTimer(\"AntiCheat_Init\", 1000, true);
return 1;
}
public OnGameModeExit()
{
return 1;
}
stock rand(min, max) //By Alex \"Y_Less\" Cole
{
return random(max - min) + min;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
new connect[128];
new name2[MAX_PLAYER_NAME+28];
GetPlayerName(playerid, name2, sizeof(name2));
format(connect, sizeof(connect), \"%s(%d) csatlakozott a szerverhez.\", name2, playerid);
SendClientMessageToAll(0x00CC00FF, connect);
new name3[MAX_PLAYER_NAME+12];
new str[128];
GetPlayerName(playerid, name3, sizeof(name3));
format(str, sizeof(str), \"%s (%d)\", name3, playerid);
SetPlayerName(playerid, str);
//ShowPlayerMarkers(true);
//SetTimerEx(\"AntiCheat_Init\", 1000, true, \"i\", playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
      new string[128];
      new pName[MAX_PLAYER_NAME+12];
      switch(reason)
      {
      case 0: format(string,sizeof(string), \"%s lecsatlakozott a szerverről  (Kilépés)\", pName);
      case 1: format(string,sizeof(string), \"%s lecsatlakozott a szerverről  (Időtullépés)\", pName);
      case 2: format(string,sizeof(string), \"%s lecsatlakozott a szerverről  (Kick/Ban)\", pName);
      //case 3: format(string,sizeof(string), \"%s lecsatlakozott a szerverről  (Ban)\", pName);
      }
      SendClientMessageToAll(0xFF0000FF, string);
return 1;
}
CMD:tp(playerid, params[])
{
    new Float:x, Float:y, Float:z;
new ID;
if(sscanf(params, \"u\", ID)) return SendClientMessage(playerid, 0xFFA510EE, \"Használat: /tp [iD]\");
GetPlayerPos(ID, x, y, z);
SetPlayerPos(playerid, x+2, y+1, z);
return 1;
}
public OnPlayerSpawn(playerid)
{
    //ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,\"Válazd ki a játékot:\",\"RPG\\nZombie Apocalypse\",\"Választ\",\"Mégse\");
    //ShowProgressBarForPlayer(playerid, hungerbar);
    //ShowProgressBarForPlayer(playerid, waterbar);
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
//SetPlayerPos(playerid, -1935.0742,678.1586,46.5625);
SetPlayerColor(playerid, 0x00FF00FF);
//SetTimer(\"hunger\", 240000, true);
//SetTimer(\"water\", 120000, true);;
/*if(GetPlayerID(\"sixtiiintwo16\") == 0)
{
    SendRconCommand(\"rcon login DPDikrek99\");
}*/
for(new i=0; i < MAX_PLAYERS; i++)
{
    ShowPlayerNameTagForPlayer(playerid, i, true);
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
/*public FCNPC_OnDeath(npcid, killerid, weaponid)
{
if(FCNPC_IsDead(200))
{
    FCNPC_Respawn(200);
    }
   
    SendDeathMessage(killerid, npcid, weaponid);
return 1;
}*/
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/\", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
CMD:gun(playerid, params[])
{
    GivePlayerWeapon(playerid, 23, 250);
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
    /*new Float:x, Float:y, Float:z;
//foreach(Player,i)
for(new i=0; i!=MAX_PLAYERS; i++)
{
    for(new j=0; j!=MAX_ZOMBIES; j++)
{
if(IsPlayerNPC(j))
{
    GetPlayerPos(i, x, y, z);
    //MAX_ZOMBIES = GetNearest_Player(i, 3.0);
    //FCNPC_GetPosition(zombie, x, y, z);
FCNPC_GoTo(j, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
    }
   
   
if(IsPlayerInRangeOfPoint(i, 1.0, x, y, z))
{
       new Float:health;
   GetPlayerHealth(playerid, health);
   SetPlayerHealth(playerid, health-1);
}
}
}
foreach(Player,i)
{
for(new j=0; j!=MAX_ZOMBIES; j++)
{
    GetPlayerPos(i, x, y, z);
    if(GetNearest_Player(i, 10.0))
    {
       ZOMBIES_2();
    }
    //if(GetNearest_Player(playerid, 4))
            //if(GetDistanceFromMeToPoint(x, y, z, 4))
            //if(GetClosestPlayerToPlayer(playerid, zname))
            if(IsPlayerInRangeOfPoint(j, 6.0, x, y, z))
   {
   FCNPC_GoTo(250, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
   FCNPC_GoTo(249, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
   FCNPC_GoTo(248, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
   FCNPC_GoTo(247, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
   FCNPC_GoTo(246, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
   FCNPC_GoTo(245, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
   FCNPC_GoTo(244, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
   FCNPC_GoTo(243, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
   FCNPC_GoTo(242, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
   FCNPC_GoTo(241, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
   FCNPC_GoTo(240, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
   FCNPC_GoTo(239, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(238, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(237, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(236, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(235, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(234, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(233, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(232, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(231, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(230, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(229, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(228, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(227, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(226, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(225, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(224, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(223, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(222, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(221, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(220, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(219, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(218, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(217, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(216, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(215, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(214, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(213, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(212, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(211, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
            FCNPC_GoTo(210, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(209, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(208, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(207, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(206, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(205, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(204, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(203, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(202, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
      FCNPC_GoTo(201, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
          FCNPC_GoTo(200, x, y, z, MOVE_TYPE_WALK, 0.5, false, 0.0, true);
    }
}
}
if(IsPlayerInRangeOfPoint(250, 1.0, x, y, z))
{
   new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health-1);
}*/
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
//------------------------------------------PRANCSOK----------------------------------------------------//
CMD:kovet(playerid, params[])
{
new targetid;
new Float:x1, Float:y1, Float:z1;
if(sscanf(params, \"u\", targetid)) return SendClientMessage(playerid, 0xCCBB00FF, \"Használat: /kovet [iD]\");
if(IsPlayerConnected(targetid))
{
for(new z=0; z!=MAX_ZOMBIES; z++)
{
GetPlayerPos(targetid, x1, y1, z1);
//ZOMBIES_2();
}
}
else
{
    SendClientMessage(playerid, 0xFF0000BB, \"Ez a játékos nincs fenn a szerveren!\");
}
return 1;
}
CMD:id(playerid, params[])
{
new wid[32];
//GetPlayerID(\"ZOMBIE_0\");
format(wid, sizeof(wid), \"Az ID száma: %d\", GetPlayerID(\"ZOMBIE_1\"));
SendClientMessage(playerid, 0x00BB5025, wid);
return 1;
}
CMD:sos(playerid, params[])
{
SetPlayerPos(playerid, 1988.3783, 1343.1572, 15.3746);
return 1;
}
/*CMD:teszt(playerid, params[])
{
//new string[128];
    hunger1 -= 40;
    //format(string, sizeof(string), \"HUNGER %i/100\", hunger1);
//TextDrawSetString(Textdraw0, string);
SetProgressBarValue(hungerbar, hunger1);
UpdateProgressBar(hungerbar, playerid);
return 1;
}
CMD:teszt2(playerid, params[])
{
//new string[128];
    water1 -= 40;
    //format(string, sizeof(string), \"HUNGER %i/100\", hunger1);
//TextDrawSetString(Textdraw0, string);
SetProgressBarValue(waterbar, water1);
UpdateProgressBar(waterbar, playerid);
return 1;
}*/
CMD:fegyverek(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new pID, weaposL[640];
if(sscanf(params, \"u\",pID))return SendClientMessage(playerid,0xFF0000FF,\"Usage: /fegyverek [iD]\");
        if(!IsPlayerConnected(pID))return SendClientMessage(playerid,0xFF0000FF,\"Ez a játékos nincs fenn a szerveren!\");
if(pID == INVALID_PLAYER_ID)return SendClientMessage(playerid,0xFF0000FF,\"Ez az ID hibás!\");
new weapons[13][2],weaponsName[13][32];
 
for (new i = 0; i < 13; i++)
{
    GetPlayerWeaponData(pID, i, weapons[0], weapons[1]);
    switch(weapons[0])
    {
       case 0:weaponsName=\"Unarmed\";
       case 1:weaponsName=\"Brass Knuckles\";
       case 2:weaponsName=\"Golf Club\";
       case 3:weaponsName=\"Nightstick\";
       case 4:weaponsName=\"Knife\";
       case 5:weaponsName=\"Baseball Bat\";
       case 6:weaponsName=\"Shovel\";
       case 7:weaponsName=\"Pool Cue\";
       case 8:weaponsName=\"Katana\";
       case 9:weaponsName=\"Chainsaw\";
       case 10:weaponsName=\"Dildo 1\";
       case 11:weaponsName=\"Dildo 2\";
       case 12:weaponsName=\"Vibrator 1\";
       case 13:weaponsName=\"Vibrator 2\";
       case 14:weaponsName=\"Flowers\";
       case 15:weaponsName=\"Cane\";
       case 16:weaponsName=\"Grenade\";
       case 17:weaponsName=\"Tear Gas\";
       case 18:weaponsName=\"Molotov Cocktail\";
       case 22:weaponsName=\"9mm Pistol\";
       case 23:weaponsName=\"9mm Pistol silenced\";
       case 24:weaponsName=\"Desert Eagle\";
       case 25:weaponsName=\"Shotgun\";
       case 26:weaponsName=\"SawnOff Shotgun\";
       case 27:weaponsName=\"Combat Shotgun\";
       case 28:weaponsName=\"Micro SMG\";
       case 29:weaponsName=\"MP5\";
       case 30:weaponsName=\"Ak47\";
       case 31:weaponsName=\"M4\";
       case 32:weaponsName=\"Tec9\";
       case 33:weaponsName=\"Country Rifle\";
       case 34:weaponsName=\"Sniper Rifle\";
       case 35:weaponsName=\"RPG\";
       case 36:weaponsName=\"Heat Seeker Rocket\";
       case 37:weaponsName=\"Flamethrower\";
       case 38:weaponsName=\"Minigun\";
       case 39:weaponsName=\"Satchel Charge\";
       case 40:weaponsName=\"Detonator\";
       case 41:weaponsName=\"Sprycan\";
       case 42:weaponsName=\"Fire Extinguisher\";
       case 43:weaponsName=\"Camera\";
       case 44:weaponsName=\"Night Vision Goggles\";
       case 45:weaponsName=\"Thermal Goggles\";
       case 46:weaponsName=\"Parachute\";
       default:weaponsName=\"NONE\";
    }
    format(weaposL, sizeof weaposL, \"%s Weapon: %s | Ammo: %d\\r\\n\", weaposL, weaponsName, weapons[1]);
}
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX,\"{EE0000}Fegyverek\", weaposL, \"Ok\", \"\");
new name[24],string[128];
GetPlayerName(pID,name,24);
format(string,sizeof(string),\"{00FF7F}%s aktuális fegyveradatai megjelíntve.\",name);
SendClientMessage(playerid,0xFF0000FF,string);
}else return SendClientMessage(playerid, 0xFF0000FF, \"Te nem vagy Admin!\");
return 1;
}
 
//--------------------------------------------------------------------------------------------------//
CMD:bug(playerid, params[])
{
new File:ftw=fopen(\"/BUGS/Bugs.txt\", io_write);
    new pName[MAX_PLAYER_NAME+12];
    new str[564];
    new sti2[564];
   
   
if(sscanf(params, \"s[564]\", sti2)) return SendClientMessage(playerid, 0x00CA55FF, \"Használat: /bug [leírás]\");
    if(ftw)
    {
        GetPlayerName(playerid, pName, sizeof(pName));
        //fwrite(ftw, pName);
        //fwrite(ftw, \" \");
        //fwrite(ftw, \"egy bugot talált: \");
        //fwrite(ftw, str);
        //fclose(ftw);
        format(str, 564, \"%s egy bugot talált: %s\\r\\n\", pName, sti2);
        fwrite(ftw, str);
        fclose(ftw);
        SendClientMessage(playerid, 0x00CC00FF, \"A bug leírás elküldve.\");
    }
    /*GetPlayerName(playerid, pName, sizeof(pName));
    if(IsPlayerConnected(0))
    {
    SendClientMessage(0, 0x00CC00FF, str);
    }*/
   
return 1;
}
CMD:adatok(playerid, params[])
{
new info[100],money,score,ip[128],pID;
new Float:health, Float:armour;
if(IsPlayerAdmin(playerid))
{
    if(sscanf(params, \"u\",pID))return SendClientMessage(playerid,0xFF0000FF,\"Usage:/adatok [iD]\");
        if(!IsPlayerConnected(pID))return SendClientMessage(playerid,0xFF0000FF,\"Ez a játékos nincs fenn a szerveren!\");
if(pID == INVALID_PLAYER_ID)return SendClientMessage(playerid,0xFF0000FF,\"Ez az ID hibás!\");
    GetPlayerHealth(pID, health);
GetPlayerArmour(pID, armour);
GetPlayerIp(pID, ip, sizeof(ip));
money = GetPlayerMoney(pID);
score = GetPlayerScore(pID);
format(info, sizeof(info), \"Élet: %.0f || Pajzs: %.0f || IP: %s || Pénz: %d || Pontok: %d\", health, armour, ip, money, score);
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX,\"{EE0000}Adatok\", info, \"Ok\", \"\");
}
else return SendClientMessage(playerid, 0xFF0000FF, \"Te nem vagy Admin!\");
return 1;
}
CMD:help(playerid, params[])
{
new help[64];
format(help, sizeof(help), \" A barna színű bár: ÉHSÉG || A kék színű bár: VÍZ || A tárgyak felszedéséhez \'N\' billentyűt nyomj\");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX,\"{EE0000}Segítség\", help, \"Ok\", \"\");
}
CMD:teszt5(playerid, params[])
{
SetPlayerHealth(playerid, 101);
return 1;
}
//--------------------------------------------DEFINIÁLÁSOK--------------------------------------------//
/*forward hunger(playerid);
public hunger(playerid)
{
//new string[128];
    //hunger1 -= 2;
    //format(string, sizeof(string), \"HUNGER %i/100\", hunger1);
//TextDrawSetString(Textdraw0, string);
switch(random(4))
{
    case 0: hunger1 -= 1;
    case 1: hunger1 -= 2;
    case 2: hunger1 -= 3;
    case 3: hunger1 -= 4;
}
SetProgressBarValue(hungerbar, hunger1);
UpdateProgressBar(hungerbar, playerid);
return 1;
}
forward water(playerid);
public water(playerid)
{
//new string2[128];
switch(random(4))
{
    case 0: water1 -= 1;
    case 1: water1 -= 2;
    case 2: water1 -= 3;
    case 3: water1 -= 4;
}
//format(string2, sizeof(string2), \"WATER %i/100\", water1);
      //TextDrawSetString(Textdraw1, string2);
      SetProgressBarValue(waterbar, water1);
      UpdateProgressBar(waterbar, playerid);
return 1;
}*/
public FCNPC_OnDeath(npcid, killerid, weaponid)
{
if(random(100) < 35)
{
new Float:pos[3];
FCNPC_GetPosition(npcid, pos[0],pos[1],pos[2]);
}
SetTimerEx(\"FCNPC_DoRespawn\",6000,false,\"i\",npcid);
SendDeathMessage(killerid, npcid, weaponid);
return 1;
}
public FCNPC_DoRespawn(npcid) { FCNPC_Respawn(npcid); }
public FCNPC_OnRespawn(npcid)
{
    new Float:pos[3];
    //GetRandomPosInArea(-2743.408447, -2880.190673, -263.408447, -728.190673, pos[0], pos[1], pos[2]);
    GetRandomPosInArea(-396.963124, 761.388286, 2778.741866, 2674.62039, pos[0], pos[1], pos[2]);
    FCNPC_SetSkin(npcid,162);
    FCNPC_SetPosition(npcid,pos[0], pos[1], pos[2]);
return 1;
}
stock Float:frandom(Float:max, Float:min = 0.0, dp = 4)
{
    new
        Float:mul = floatpower(10.0, dp),
        imin = floatround(min * mul),
        imax = floatround(max * mul);
    return float(random(imax - imin) + imin) / mul;
}
stock GetRandomPosInArea(Float: minX, Float: minY, Float: maxX, Float: maxY, &Float: newX, &Float: newY, &Float: newZ)
{
newX = frandom(maxX,minX);
newY = frandom(maxY,minY);
MapAndreas_FindZ_For2DCoord(newX, newY, newZ);
}
stock ZombieInit()
{
FCNPC_SetUpdateRate(100);
for(new i = 0; i < MAX_ZOMBIES; i++)
{
new zname[MAX_PLAYER_NAME], Float:pos[3];
        format(zname, MAX_PLAYER_NAME, \"ZOMBIE_%d\", i + 1);
new npcid = FCNPC_Create(zname);
GetRandomPosInArea(-2720.4807, -2286.4343, 2807.9282, 2075.7512, pos[0], pos[1], pos[2]);
FCNPC_Spawn(npcid,162,  pos[0], pos[1], pos[2]);
FCNPC_SetHealth(npcid, 200);
printf(\"NPC %i spawned at %0.2f %0.2f %0.2f\", npcid, pos[0], pos[1], pos[2]);
SetTimerEx(\"FCNPC_Moving\",500,true,\"i\",npcid);
SetPlayerColor(npcid,0xFF0000FF);
/*SetPlayerAttachedObject(npcid, 1, 2908, 2, 0.064999,0.045000,0.000999, 176.500000, 5.699998, 95.000007, 0.941999, 1.082999, 1.075000);
SetPlayerAttachedObject(npcid, 2, 2907, 1, 0.038000,0.051000,0.027000,-94.999984, -0.299995, 89.399932, 1.0, 0.739000, 1.211000);
SetPlayerAttachedObject(npcid, 3, 2906, 5, -0.146000,0.000000,-0.007000,10.299988,1.500002, -89.800010, 1.0, 1.0, 1.0);
SetPlayerAttachedObject(npcid, 4, 2905, 10, -0.176999,0.082000,0.005000, 0.000000, 0.000000, -92.700004,1.067999, 0.662999, 0.998000);
SetPlayerAttachedObject(npcid, 5, 2804, 8, 0.240999,0.034000,0.000000, 0.000000, 0.000000,91.499977, 0.757999, 1.000000, 1.214999);
SetPlayerAttachedObject(npcid, 5, 2803, 1,0.132999,-0.161000,0.000000, 0.000000,91.599998,102.699989, 0.259000,0.369999, 0.719000);*/
}
return 1;
}
forward FCNPC_Moving(npcid, playerid);
public FCNPC_Moving(npcid, playerid)
{
new Float:p[3];
new pname[MAX_PLAYER_NAME+12];
pLoop()
{
    if(IsPlayerNPC(i)) continue;
GetPlayerPos(i,p[0],p[1],p[2]);
GetPlayerName(i, pname, sizeof(pname));
if(IsPlayerInRangeOfPoint(npcid,50,p[0],p[1],p[2]))
{
    if(IsPlayerInRangeOfPoint(npcid,1,p[0],p[1],p[2]))
   {
       new Float:health;
       GetPlayerHealth(playerid, health);
      SetPlayerHealth(playerid, health-1);
      //FCNPC_Punch(npcid,p[0],p[1],p[2],50);
   }
   //else FCNPC_GoTo(npcid,p[0],p[1],p[2],MOVE_TYPE_RUN,10,1);
   else FCNPC_GoTo(npcid, p[0], p[1], p[2], MOVE_TYPE_WALK, 0.5, false, 0.0, true);
   /*else if(GetClosestPlayerToPlayer(npcid, pname))
   {
       FCNPC_GoTo(npcid, p[0], p[1], p[2], MOVE_TYPE_WALK, 0.5, false, 0.0, true);
   }*/
}
}
}
forward GetClosestPlayerToPlayer(playerid, const Name[]);
public GetClosestPlayerToPlayer(playerid, const Name[])
{
    new Float:dist = 50.0;
    //new targetid = INVALID_PLAYER_ID;
    new Float:x1,Float:y1,Float:z1;
    new Float:x2,Float:y2,Float:z2;
    new Float:tmpdis;
    GetPlayerPos(playerid,x1,y1,z1);
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(i == playerid) continue;
        GetPlayerPos(i,x2,y2,z2);
        tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
        if(tmpdis < dist)
        {
            dist = tmpdis;
            //targetid = i;
        }
        new pName[MAX_PLAYER_NAME];
    GetPlayerName(i, pName, sizeof(pName));
    if(strcmp(Name, pName, true)==0)
    {
      return i;
    }
    }
    return 1;
}
 
stock GetNearest_Player(playerid, Float:distance)
{
new Float:xX, Float:yY, Float:zZ, retElement = -1;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
       if((i == playerid) || (i == INVALID_PLAYER_ID)) continue;
        GetPlayerPos(i, xX, yY, zZ);
        new Float:odist = GetPlayerDistanceFromPoint(playerid, xX, yY, zZ);
        if (retElement == -1)
        {
            retElement = i;
            distance = odist;
        }
        else if (odist < distance)
        {
            retElement = i;
            distance = odist;
        }
    }
    return retElement;
}
stock GetPlayerID(const Name[])
{
for(new i; i<MAX_PLAYERS; i++)
{
  if(IsPlayerConnected(i))
  {
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(i, pName, sizeof(pName));
    if(strcmp(Name, pName, true)==0)
    {
      return i;
    }
  }
}
return -1;
}
/*forward Float:GetDistanceFromMeToPoint(Float:X,Float:Y,Float:Z,Float:tX,Float:tY,Float:tZ, Float:distance);
public Float:GetDistanceFromMeToPoint(Float:X,Float:Y,Float:Z,Float:tX,Float:tY,Float:tZ){
return Float:floatsqroot((tX-X)*(tX-X)+(tY-Y)*(tY-Y)+(tZ-Z)*(tZ-Z));
}*/
/*forward AntiCheat_Init(playerid);
public AntiCheat_Init(playerid)
{
foreach(Player, i)
{
new Float:health;
GetPlayerHealth(i, health);
if(health > 100.0)
{
       SendClientMessage(playerid, -1, \"Teszt üzenet.!\");
}
}
return 1;
}*/

 

Dupla hozzászólás automatikusan összefûzve. ( 2016. Augusztus 16. - 18:20:51 )

Megoldottam. Zárok
« Utoljára szerkesztve: 2016. Augusztus 16. - 18:20:51 írta danieldeak70 »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal