/* ==================== [ Holtest Rendszer ] ==================== *//* ============================================================== *//* ======================= [ Készítette ] ======================= *//* ============================================================== *//* =================== [ Amf | SampForum.hu ] =================== *//* ============================================================== *//* ================== [ !!! NE TÖRÖLD KI !!! ] ================== *//* ============================================================== */#include <a_samp>#include <foreach>#include <streamer>#include <zcmd>#define PIROS 0xFF0000AAnew Gyilkos[MAX_PLAYERS], Holtest[MAX_PLAYERS], Object[MAX_PLAYERS];new Float:Yh[MAX_PLAYERS], Float:Xh[MAX_PLAYERS], Float:Zh[MAX_PLAYERS];public OnPlayerDeath(playerid, killerid, reason){DestroyDynamicObject(Object [playerid]);GetPlayerPos(playerid, Yh[playerid], Xh[playerid], Zh[playerid]); Object[playerid] = CreateDynamicObject(3092, Yh[playerid], Xh[playerid], Zh[playerid], 0, 90, 274);Gyilkos[playerid] = killerid;Holtest[playerid] = playerid;}CMD:azonosit(playerid, params[]) //Csak természetes halálnál írja ki a gyilkost is!Ha parancsal ölöd meg, akkor nem!//{if(IsPlayerAdmin(playerid)){foreach (Player, i){ if(IsPlayerInRangeOfPoint(playerid, 3, Yh, Xh, Zh)) { new name[128]; new name2[128]; new string[100]; GetPlayerName(Gyilkos, name, sizeof(name)); GetPlayerName(Holtest, name2, sizeof(name2)); format(string, sizeof(string),\"Holtest: %s Megölte: %s\",name2, name); SendClientMessage(playerid, PIROS, string); DestroyDynamicObject(Object [playerid]); } else { SendClientMessage(playerid, PIROS, \"Nincs a közeledben holtest!\"); }}}else{ SendClientMessage(playerid, PIROS, \"Nem vagy Admin!\");}return 1;}
Holtest helyett Holttest! Egyébként szép kis code.
/* ==================== [ Holttest Rendszer ] ==================== *//* ============================================================== *//* ======================= [ Készítette ] ======================= *//* ============================================================== *//* =================== [ Amf | SampForum.hu ] =================== *//* ============================================================== *//* ================== [ !!! NE TÖRÖLD KI !!! ] ================== *//* ============================================================== */#include <a_samp>#include <streamer>#include <zcmd>#define PIROS 0xFF0000AA#define MAX_HOLTTEST 50new Gyilkos[MAX_HOLTTEST], holttest[MAX_HOLTTEST], Object[MAX_HOLTTEST],pht[MAX_PLAYERS];new Float:Yh[MAX_HOLTTEST]= 0.000, Float:Xh[MAX_HOLTTEST] = 0.000, Float:Zh[MAX_HOLTTEST] = 0.000;stock NextHolt(){for(new i; i<=MAX_HOLTTEST; i++){if(Yh <= 0.000 && Xh <= 0.000 && Zh <= 0.000) return i;}return 1;}stock DestroyHolt(h){DestroyDynamicObject(Object[h]);Gyilkos[h] = 0;holttest[h] = 0;Yh[h] = 0.000;Xh[h] = 0.000;Zh[h] = 0.000;return 1;} stock DestroyHoltEx(playerid){if(pht[playerid] != 0){DestroyDynamicObject(Object[pht[playerid]]);Gyilkos[pht[playerid]] = 0;holttest[pht[playerid]] = 0;Yh[pht[playerid]] = 0.000;Xh[pht[playerid]] = 0.000;Zh[pht[playerid]] = 0.000;pht[playerid] = 0;}return 1;}public OnPlayerDeath(playerid, killerid, reason){DestroyHoltEx(playerid);new ht = NextHolt();GetPlayerPos(playerid, Yh[ht], Xh[ht], Zh[ht]);Object[ht] = CreateDynamicObject(3092, Yh[ht], Xh[ht], Zh[ht], 0, 90, 274);Gyilkos[ht] = killerid;holttest[ht] = playerid;pht[playerid] = ht;return 1;}CMD:azonosit(playerid, params[]) //Csak természetes halálnál írja ki a gyilkost is!Ha parancsal ölöd meg, akkor nem!//{if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, PIROS, \"Nem vagy admin!\");for(new i; i<=MAX_HOLTTEST; i++) {if(!IsPlayerInRangeOfPoint(playerid, 3, Yh, Xh, Zh)) return SendClientMessage(playerid, PIROS, \"Nincs a közeledben holttest!\");new name[128];new name2[128];new string[100];GetPlayerName(Gyilkos, name, sizeof(name));GetPlayerName(holttest, name2, sizeof(name2));format(string, sizeof(string),\"Holttest: %s Megölte: %s\",name2, name);SendClientMessage(playerid, PIROS, string);DestroyDynamicObject(Object);for(new p; p<MAX_PLAYERS; p++) { if(i == pht[p]) return pht[p] = 0; }DestroyHolt(i); }return 1;}