#include <a_samp>
#include <zcmd>
stock pName(playerid)
{
new name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
new pick;
new megtalaltak;
new jutalom[512];
new Float:X, Float:Y, Float:Z;
CMD:event(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new string[512];
format(string, sizeof(string), \"{00ff00}Kincskeresési Infó: {ffea00}%s\", params);
SendClientMessageToAll(-1, string);
}
return 1;
}
CMD:letesz(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xff0000aa, \"Nem vagy RCON Admin!\");
if(!strlen(params)) return SendClientMessage(playerid, 0xff0000AA, \"Muszály megadnod a helyet: /letesz [hely]\");
new string[256];
megtalaltak = 1;
GetPlayerPos(playerid, X, Y, Z);
pick = CreatePickup(1276, 1, X, Y, Z, -1);
format(string, sizeof(string), \"[Kincskeresés] A Kincs elrejtve. Helye:%s.\", params);
SendClientMessageToAll(0x09ff00AA, string);
SetTimer(\"Mehet\", 5000, 0);
return 1;
}
CMD:engedelyez(playerid, params[])
{
megtalaltak = 0;
SendClientMessage(playerid, 0xffffffaa, \"Pickup engedélyezve!\");
return 1;
}
forward Mehet(playerid);
public Mehet(playerid)
{
SetTimerEx(\"pickup\", 500, 1, \"i\", playerid);
return 1;
}
forward pickup();
public pickup()
{
if(megtalaltak != 1)
for(new playerid = 0;playerid<MAX_PLAYERS;playerid++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, X, Y, Z))
{
DestroyPickup(pick);
switch(random(7))
{
case 0: GivePlayerMoney(playerid, 25000000), jutalom = \"25 milió dollár\";
case 1: SetPlayerScore(playerid, GetPlayerScore(playerid)+250), jutalom = \"250 pont\";
case 2: jutalom = \"Egy szabadon választott ház, amit az adminok adnak meg\";
case 3: SetPlayerHealth(playerid, 9999999), jutalom = \"örök élet\";
case 4: jutalom = \"1-es szintu vip, amit az adminok adnak meg\";
case 5: GivePlayerMoney(playerid, 50000000), jutalom = \"50 millió dollár\";
case 6: GivePlayerMoney(playerid, 20000000),SetPlayerScore(playerid,GetPlayerScore(playerid)+125), jutalom = \"20 milla, és 125 pont\";
}
new string[512], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), \"{ffffff}%s {09ff00}megtalálta a Kincset! {ffffff}[Jutalma: %s]\", pname, jutalom);
SendClientMessageToAll(0xffffffaa, string);
megtalaltak = 1;
}
}
return 1;
}