Szerző Téma: Re:sHitmanSystem  (Megtekintve 445 alkalommal)

Re:sHitmanSystem
« Dátum: 2012. július 15. - 11:24:19 »
0 Show voters
[gmod]Mivel a letöltõ link szerint a fájlt eltávolították és nekem megvan ezért feltettem ide code tagek közé.[/gmod]
 
#include <a_samp>
#include <sscanf2>
#include <zcmd>
enum Info
{
Bounty
};
new HitmanInfo[MAX_PLAYERS][info];
#define COLOR_RED 0x9f1212FF
#define COLOR_WHITE 0xFFFFFFFF
#define DIALOG_VERDIJAK 9751
stock GetName(playerid)
{
    new name[16];
    GetPlayerName(playerid, name, 16);
    return name;
}
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" sHitmanSystem by: Stricica\");
print(\"--------------------------------------\\n\");
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPVarInt(playerid, \"Wanted\") == 1)
{
new string[128];
GivePlayerMoney(killerid, HitmanInfo[playerid][bounty]);
format(string, sizeof(string), \"[{9cff00}%s{FFFFFF}] kilett iktatva [{9cff00}%s{FFFFFF}] által. Vérdíj-jutalom: [{9cff00}%i{FFFFFF}]\", GetName(playerid), GetName(killerid), HitmanInfo[playerid][bounty]);
SendClientMessageToAll(COLOR_WHITE, string);
SetPVarInt(playerid, \"Wanted\", 0);
HitmanInfo[playerid][bounty] = 0;
}
return 1;
}
CMD:verdij(playerid, params[])
{
new id, bounty, string[128];
    if(sscanf(params, \"ui\", id, bounty)) SendClientMessage(playerid, COLOR_RED, \"Használat: /verdij [playerid] [összeg]\");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Hiba: Nincs ilyen játékos.\");
    if(id == playerid) return SendClientMessage(playerid, COLOR_RED, \"Hiba: Magadra nem tudsz vérdíjat kitûzni.\");
    if(GetPlayerMoney(playerid) < bounty) return SendClientMessage(playerid, COLOR_RED, \"Hiba: Nincs elég pénzed a vérdíjra.\");
    if(IsPlayerNPC(id)) return SendClientMessage(playerid, COLOR_RED, \"Hiba: NPC-re nem lehet vérdíjat tûzni.\");
else {
SetPVarInt(id, \"Wanted\", 1);
HitmanInfo[id][bounty] = bounty;
GivePlayerMoney(playerid, -bounty);
format(string, sizeof(string), \"[{9cff00}%s{FFFFFF}] vérdíjat tûzött ki [{9cff00}%s{FFFFFF}] fejére. Összeg: [{9cff00}%i{FFFFFF}]\", GetName(playerid), GetName(id), bounty);
SendClientMessageToAll(COLOR_WHITE, string);
}
return 1;
}
CMD:verdijak(playerid, params[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPVarInt(i, \"Wanted\") == 1)
{
new string[128];
format(string, sizeof(string), \"[{9cff00}%s{FFFFFF}] - [{9cff00}%i ${FFFFFF}]\", GetName(i), HitmanInfo[bounty]);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
return 1;
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal