Szasztok!:D
el hoztam nektek egy envet készitõ szkiript-et amit JBauer nál találtam meg itt a fórumon!
pwn:
http://www.solidfiles.com/d/cf81186030/amx:
http://www.solidfiles.com/d/5ff613f74b/Parancsok: /createevent - Event készítés kezdése
/finishcevent - Event készítés befejezése
/finishdmevent - DM event befejezése
/join - Eventhez csatlakozás
/startevent - Event indítás.
Nem teszteltem!
pawn
#include <a_samp>
#include <sscanf2>
#include <YSI/y_ini>
#include <YSI\\y_commands>
#include <streamer>
#include <foreach>
#pragma tabsize 0
#define SCM SendClientMessage
#define COLOR_RED 0xD62F4E
#define COL_LIGHTBLUE \"{1BD3E0}\"
#define COL_RED \"{D62F4E}\"
#define COL_ORANGE \"{E09B1B}\"
#define COL_WHITE \"{FFFFFF}\"
#define DIALOG_EVENT 1093
#define EVENT_FILE \"Events/%d.ini\"
#define MAX_EVENTS 20
#define MAX_CP 50
#define MAX_TIME 15
new bool:False = false, _S_T_R_[128];
#define SendFormatMSG(%0,%1,%2,%3)\\
do{\\
format(_S_T_R_, sizeof (_S_T_R_), (%2), %3);\\
SendClientMessage((%0),(%1), _S_T_R_);\\
}\\
while (False)
#define SendFormatMSGToAll(%1,%2,%3)\\
do{\\
format(_S_T_R_, sizeof (_S_T_R_), (%2), %3);\\
SendClientMessageToAll((%1), _S_T_R_);\\
}\\
while (False)
#define randomEx(%0,%1) (random((%1) - (%0)) + (%0))
new
EventName[MAX_PLAYERS][64],
EventCP[MAX_PLAYERS],
EventID[MAX_PLAYERS],
PlayerCP[MAX_PLAYERS],
EventVehID[MAX_PLAYERS],
PlayerVeh[MAX_PLAYERS],
bool:PlayerWork[MAX_PLAYERS],
bool:PlayerCreateEvent[MAX_PLAYERS],
bool:EventWithVeh[MAX_PLAYERS],
bool:EventWithWep[MAX_PLAYERS],
EventWeapID[MAX_PLAYERS],
Text:Event0[MAX_PLAYERS],
StartedEvent,
Timer,
StartedEventTime,
Position,
WithWeap[MAX_PLAYERS],
PlayerTime[MAX_PLAYERS],
Float:PlayerPos[MAX_PLAYERS][3],
PlayerPosInt[MAX_PLAYERS],
PlayerPosVW[MAX_PLAYERS];
enum jo
{
Float:TCPX,
Float:TCPY,
Float:TCPZ,
Float:TCPA,
Name[64],
VehID,
MaxCP,
WeapID
}
new Event[MAX_EVENTS][jo];
enum ev
{
Float:CPX,
Float:CPY,
Float:CPZ,
}
new CheckPoint[MAX_EVENTS][MAX_CP][ev];
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" IG event készítõ by.: Mr. Gagi, magyarosítva: JBauer\");
print(\"--------------------------------------\\n\");
SetTimer(\"Time\",1000,true);
for(new i = 1; i<=MAX_EVENTS;i++)
{
new gFile[35];
format(gFile, 35, EVENT_FILE ,i);
INI_ParseFile(gFile, \"LoadEvent\", .bExtra = true, .extra = i);
}
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
main()
{
print(\"\\n----------------------------------\");
print(\" IG event készítõ by.: Mr. Gagi, magyarosítva: JBauer\");
print(\"----------------------------------\\n\");
}
public OnGameModeInit()
{
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
return 1;
}
public OnPlayerConnect(playerid)
{
Event0[playerid] = TextDrawCreate(55.000000, 247.000000, \"~Idõ: 2:50:3~n~CP: ~r~1/50\");
TextDrawBackgroundColor(Event0[playerid], 255);
TextDrawFont(Event0[playerid], 2);
TextDrawLetterSize(Event0[playerid], 0.210000, 1.099999);
TextDrawColor(Event0[playerid], -16711681);
TextDrawSetOutline(Event0[playerid], 1);
TextDrawSetProportional(Event0[playerid], 1);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
TextDrawDestroy(Event0[playerid]);
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
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)
{
new cpid = PlayerCP[playerid];
new nextcpid = PlayerCP[playerid]+1;
new eventid = StartedEvent;
if(cpid >= 2)
{
if(GetPlayerVehicleID(playerid) == PlayerVeh[playerid])
{
PlayerCP[playerid]++;
if(CheckPoint[eventid][nextcpid][CPX] == 0.0 && CheckPoint[eventid][nextcpid][CPY] == 0)//Last Checkpoint
{
new string[128],Price;
Position++;
switch(Position)
{
case 1: Price = randomEx(7000,9000);
case 2: Price = randomEx(5000,7000);
case 3: Price = randomEx(3000,5000);
}
GivePlayerMoney(playerid,Price);
format(string,128,\"%s befejezte a versenyt %d helyezéssel és nyert %d$-t\",GetName(playerid),Position,Price);
SendClientMessageToAll(-1,string);
PlayerCP[playerid] = 0;
DestroyVehicle(PlayerVeh[playerid]);
DisablePlayerRaceCheckpoint(playerid);
PlayerWork[playerid] = false;
SetPlayerPos(playerid,PlayerPos[playerid][0],PlayerPos[playerid][1],PlayerPos[playerid][2]);
SetPlayerInterior(playerid,PlayerPosInt[playerid]);
SetPlayerVirtualWorld(playerid,PlayerPosVW[playerid]);
TextDrawHideForPlayer(playerid,Event0[playerid]);
if(Position == 3)
{
foreach(Player, i)
{
if(PlayerCP > 0)
{
PlayerCP = 0;
DestroyVehicle(PlayerVeh);
DisablePlayerRaceCheckpoint(i);
StartedEvent = 0;
SetPlayerPos(i,PlayerPos[0],PlayerPos[1],PlayerPos[2]);
SetPlayerInterior(i,PlayerPosInt);
SetPlayerVirtualWorld(i,PlayerPosVW);
TextDrawHideForPlayer(i,Event0);
}
}
}
return 1;
}
if(nextcpid != Event[eventid][MaxCP]) SetPlayerRaceCheckpoint(playerid,0,CheckPoint[eventid][nextcpid][CPX],CheckPoint[eventid][nextcpid][CPY],CheckPoint[eventid][nextcpid][CPZ],CheckPoint[eventid][nextcpid+1][CPX],CheckPoint[eventid][nextcpid+1][CPY],CheckPoint[eventid][nextcpid+1][CPZ],5.0);
else SetPlayerRaceCheckpoint(playerid,1,CheckPoint[eventid][nextcpid][CPX],CheckPoint[eventid][nextcpid][CPY],CheckPoint[eventid][nextcpid][CPZ],CheckPoint[eventid][nextcpid][CPX],CheckPoint[eventid][nextcpid][CPY],CheckPoint[eventid][nextcpid][CPZ],5.0);
}
}
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)
{
if(newkeys == KEY_FIRE)
{
if(PlayerCreateEvent[playerid] && EventWithVeh[playerid])
{
if(EventCP[playerid] == 1)
{
new dFile[32],Float:Pos[4];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
GetPlayerFacingAngle(playerid,Pos[3]);
format(dFile, 35, EVENT_FILE, EventID[playerid]);
new
INI:File = INI_Open(dFile);
INI_WriteString(File, \"Name\", EventName[playerid]);
INI_WriteFloat(File, \"TCPX\", Pos[0]);
INI_WriteFloat(File, \"TCPY\", Pos[1]);
INI_WriteFloat(File, \"TCPZ\", Pos[2]);
INI_WriteFloat(File, \"TCPA\", Pos[3]);
INI_WriteInt(File, \"Veh\", EventVehID[playerid]);
INI_WriteInt(File, \"Weapon\", 0);
INI_Close(File);
format(Event[EventID[playerid]][Name],64,\"%s\",EventName[playerid]);
Event[EventID[playerid]][TCPX] = Pos[0];
Event[EventID[playerid]][TCPY] = Pos[1];
Event[EventID[playerid]][TCPZ] = Pos[2];
Event[EventID[playerid]][TCPA] = Pos[3];
Event[EventID[playerid]][VehID] = EventVehID[playerid];
Event[EventID[playerid]][WeapID] = 0;
EventCP[playerid]++;
}
else if(EventCP[playerid] > 1)
{
new dFile[32],Float:Pos[3],string[6];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
format(dFile, 35, EVENT_FILE, EventID[playerid]);
new
INI:File = INI_Open(dFile);
format(string,6,\"CPX%d\",EventCP[playerid]);
INI_WriteFloat(File, string, Pos[0]);
CheckPoint[EventID[playerid]][EventCP[playerid]][CPX] = Pos[0];
format(string,6,\"CPY%d\",EventCP[playerid]);
INI_WriteFloat(File, string, Pos[1]);
CheckPoint[EventID[playerid]][EventCP[playerid]][CPY] = Pos[1];
format(string,6,\"CPZ%d\",EventCP[playerid]);
INI_WriteFloat(File, string, Pos[2]);
CheckPoint[EventID[playerid]][EventCP[playerid]][CPZ] = Pos[2];
INI_Close(File);
EventCP[playerid]++;
}
}
//==============DM Event
if(PlayerCreateEvent[playerid])
{
if(PlayerCreateEvent[playerid] && EventWithWep[playerid])
{
if(EventCP[playerid] == 1)
{
new dFile[32],Float:Pos[4];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
GetPlayerFacingAngle(playerid,Pos[3]);
format(dFile, 35, EVENT_FILE, EventID[playerid]);
new
INI:File = INI_Open(dFile);
INI_WriteString(File, \"Name\", EventName[playerid]);
INI_WriteInt(File, \"Weapon\", EventWeapID[playerid]);
INI_Close(File);
format(Event[EventID[playerid]][Name],64,\"%s\",EventName[playerid]);
Event[EventID[playerid]][WeapID] = EventWeapID[playerid];
EventCP[playerid]++;
}
if(EventCP[playerid] > 1)
{
new dFile[32],Float:Pos[3],string[6];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
format(dFile, 35, EVENT_FILE, EventID[playerid]);
new
INI:File = INI_Open(dFile);
format(string,6,\"CPX%d\",EventCP[playerid]);
INI_WriteFloat(File, string, Pos[0]);
CheckPoint[EventID[playerid]][EventCP[playerid]][CPX] = Pos[0];
format(string,6,\"CPY%d\",EventCP[playerid]);
INI_WriteFloat(File, string, Pos[1]);
CheckPoint[EventID[playerid]][EventCP[playerid]][CPY] = Pos[1];
format(string,6,\"CPZ%d\",EventCP[playerid]);
INI_WriteFloat(File, string, Pos[2]);
CheckPoint[EventID[playerid]][EventCP[playerid]][CPZ] = Pos[2];
INI_Close(File);
EventCP[playerid]++;
}
}
}
}
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
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[])
{
switch(dialogid)
{
case DIALOG_EVENT:
{
if(!response) return 1;
switch(listitem)
{
case 0://Sa
{
SCM(playerid,-1,\"Válaszd ki az autót az eseményhez.\");
ShowPlayerDialog(playerid,DIALOG_EVENT+1,DIALOG_STYLE_INPUT,\"Esemény név\",\"Írd be az esemény nevét\",\"Oké\",\"Mégse\");
EventWithVeh[playerid] = true;
}
case 1://DM
{
SCM(playerid,-1,\"Válaszd ki a fegyvert az eseményhez.\");
ShowPlayerDialog(playerid,DIALOG_EVENT+1,DIALOG_STYLE_INPUT,\"Esemény név\",\"Írd be az esemény nevét\",\"Oké\",\"Mégse\");
EventWithWep[playerid] = true;
}
}
}
case DIALOG_EVENT+1:
{
if(!response) return 1;
if(EventWithVeh[playerid])
{
format(EventName[playerid],64,\"%s\",inputtext);
ShowPlayerDialog(playerid,DIALOG_EVENT+2,DIALOG_STYLE_INPUT,\"Az esemény autója\",\"Írd be az autó idjét\",\"Oké\",\"Mégse\");
}
if(EventWithWep[playerid])
{
format(EventName[playerid],64,\"%s\",inputtext);
ShowPlayerDialog(playerid,DIALOG_EVENT+3,DIALOG_STYLE_INPUT,\"Az esemény fegyvere\",\"Írd be a fegyver idjét\",\"Oké\",\"Mégse\");
}
}
case DIALOG_EVENT+2:
{
if(!response) return 1;
if(EventWithVeh[playerid])
{
EventCP[playerid] = 1;
EventVehID[playerid] = strval(inputtext);
SCM(playerid,-1,\"Nyomd le a BAL EGÉRGOMBOT, hogy beállítsd a cp-t. Ha befejezted írd be: /finishcevent\");
}
}
case DIALOG_EVENT+3:
{
if(!response) return 1;
EventWeapID[playerid] = strval(inputtext);
EventCP[playerid] = 1;
SCM(playerid,-1,\"Nyomd le a BAL EGÉRGOMBOT, hogy beállítsd a játékosok kezdõ helyét. Ha befejezted írd be: /finishcevent\");
new dFile[32];
format(dFile, 35, EVENT_FILE, EventID[playerid]);
new
INI:File = INI_Open(dFile);
INI_WriteString(File, \"Name\", EventName[playerid]);
INI_WriteInt(File, \"Weapon\", EventWeapID[playerid]);
INI_Close(File);
format(Event[EventID[playerid]][Name],64,\"%s\",EventName[playerid]);
Event[EventID[playerid]][WeapID] = EventWeapID[playerid];
EventCP[playerid]++;
}
case DIALOG_EVENT+4:
{
if(!response) return 1;
StartedEvent = strval(inputtext);
StartedEventTime = MAX_TIME;
SendFormatMSGToAll(-1,\" Esemény: %s elindult. Maradt %d másodperced a csatlakozásra. Írd be: /join\",Event[strval(inputtext)][Name],MAX_TIME);
Timer = SetTimer(\"EventTime\",1000,true);
}
}
return 1;
}
forward EventTime();
public EventTime()
{
StartedEventTime--;
if(StartedEventTime == MAX_TIME/2) SendFormatMSGToAll(-1,\" %d másodperced maradt, hogy csatlakozz\",MAX_TIME/2);
if(StartedEventTime == 5)
{
SendClientMessageToAll(-1,\"Az esemény indul 5 másodperc múlva\");
}
if(StartedEventTime == 0)
{
foreach(Player, i)
{
if(PlayerCP > 0)
{
new string[128];
PlayerTime = 0;
SetPlayerRaceCheckpoint(i,0,CheckPoint[startedEvent][PlayerCP][CPX],CheckPoint[startedEvent][PlayerCP][CPY],CheckPoint[startedEvent][PlayerCP][CPZ],CheckPoint[startedEvent][PlayerCP+1][CPX],CheckPoint[startedEvent][PlayerCP+1][CPY],CheckPoint[startedEvent][PlayerCP+1][CPZ],5.0);
TogglePlayerControllable(i,true);
GameTextForPlayer(i,\"~g~GO GO GO!!!\",3000,0);
format(string,sizeof(string),\"Idõ: 00:00~n~CP: ~r~%d/%d\",PlayerCP-1,Event[startedEvent][MaxCP]);
TextDrawSetString(Event0,string);
PutPlayerInVehicle(i,PlayerVeh,0);
KillTimer(Timer);
}
if(Event[startedEvent][WeapID] != 0 && WithWeap == 1)
{
GameTextForPlayer(i,\"~g~GO GO GO!!!\",3000,0);
TogglePlayerControllable(i,true);
KillTimer(Timer);
}
}
}
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
YCMD:createevent(playerid,params[],help)
{
#pragma unused help
#pragma unused params
new dFile[32];
if(!IsPlayerAdmin(playerid)) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"RCON adminnak kell lenned!\");
if(PlayerCreateEvent[playerid]) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Már készítesz egy eseményt!\");
ShowPlayerDialog(playerid,DIALOG_EVENT,DIALOG_STYLE_LIST,\"Esemény\",\"Autókkal\\nDM esemény fegyverekkel\",\"Választ\",\"Mégse\");
PlayerCreateEvent[playerid] = true;
EventID[playerid] = 1;
for(new id = 1; id <= MAX_EVENTS;id++)
{
format(dFile, 35, EVENT_FILE, id);
if(fexist(dFile)) EventID[playerid]++;
if(EventID[playerid] > MAX_EVENTS) return SCM(playerid,-1,\"Írd át a MAX_EVENTS-et az FS-ben.\");
}
return 1;
}
YCMD:finishcevent(playerid,params[],help)
{
#pragma unused help
#pragma unused params
new dFile[32];
if(!IsPlayerAdmin(playerid)) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"RCON adminnak kell lenned!\");
if(!PlayerCreateEvent[playerid]) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Már készítesz egy eseményt!\");
SCM(playerid,-1,\"Befejezted az esemény készítést.\");
PlayerCreateEvent[playerid] = false;
if(EventWithVeh[playerid] || EventWithWep[playerid])
{
format(dFile, 32, EVENT_FILE, EventID[playerid]);
new
INI:File = INI_Open(dFile);
INI_WriteInt(File, \"MaxCP\", EventCP[playerid]-1);
Event[EventID[playerid]][MaxCP] = EventCP[playerid]-1;
INI_Close(File);
}
return 1;
}
YCMD:finishdmevent(playerid,params[],help)
{
#pragma unused help
#pragma unused params
if(!IsPlayerAdmin(playerid)) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Nem vagy RCON admin!\");
if(StartedEvent == 0) return SCM(playerid,COLOR_RED,\"Nincsen elindított esemény\");
if(Event[startedEvent][WeapID] == 0) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Nincsen elindítva DM esemény!\");
foreach(Player, i)
{
if(WithWeap == 1)
{
WithWeap = 0;
SetPlayerAmmo(i,Event[startedEvent][WeapID],0);
SetPlayerPos(i,PlayerPos[0],PlayerPos[1],PlayerPos[2]);
SetPlayerInterior(i,PlayerPosInt);
SetPlayerVirtualWorld(i,PlayerPosVW);
}
}
StartedEvent = 0;
return 1;
}
YCMD:join(playerid,params[],help)
{
#pragma unused help
#pragma unused params
new string[128];
if(StartedEvent == 0) return SCM(playerid,COLOR_RED,\"Nincsen elindított esemény\");
if(StartedEventTime == 0) return SCM(playerid,COLOR_RED,\"Már elkezdõdött.\");
new Float:Pos[3]; GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
if(Event[startedEvent][WeapID] == 0)
{
Event[startedEvent][TCPX] -= (6 * floatsin(-Event[startedEvent][TCPA], degrees));
Event[startedEvent][TCPY] -= (6 * floatcos(-Event[startedEvent][TCPA], degrees));
printf(\"%f\",Event[startedEvent][TCPX]);
PlayerCP[playerid] = 2;
PlayerTime[playerid] = 0;
if(Event[startedEvent][VehID] != 0) { PlayerVeh[playerid] = CreateVehicle(Event[startedEvent][VehID],Event[startedEvent][TCPX],Event[startedEvent][TCPY],Event[startedEvent][TCPZ],Event[startedEvent][TCPA],random(128),random(128),3600);}
SetPlayerPos(playerid,Event[startedEvent][TCPX],Event[startedEvent][TCPY],Event[startedEvent][TCPZ]);
PutPlayerInVehicle(playerid,PlayerVeh[playerid],0);
PlayerPos[playerid][0] = Pos[0];
PlayerPos[playerid][1] = Pos[1];
PlayerPos[playerid][2] = Pos[2];
PlayerPosInt[playerid] = GetPlayerInterior(playerid);
PlayerPosVW[playerid] = GetPlayerVirtualWorld(playerid);
format(string,sizeof(string),\"Idõ: 00:00~n~CP: ~r~%d/%d\",PlayerCP[playerid]-1,Event[startedEvent][MaxCP]);
TextDrawSetString(Event0[playerid],string);
TextDrawShowForPlayer(playerid,Event0[playerid]);
TogglePlayerControllable(playerid,false);
}
if(Event[startedEvent][WeapID] != 0)
{
new cp = randomEx(2,Event[startedEvent][MaxCP]);
SetPlayerPos(playerid,CheckPoint[startedEvent][cp][CPX],CheckPoint[startedEvent][cp][CPY],CheckPoint[startedEvent][cp][CPZ]);
GivePlayerWeapon(playerid,Event[startedEvent][WeapID],999);
PlayerPos[playerid][0] = Pos[0];
PlayerPos[playerid][1] = Pos[1];
PlayerPos[playerid][2] = Pos[2];
PlayerPosInt[playerid] = GetPlayerInterior(playerid);
PlayerPosVW[playerid] = GetPlayerVirtualWorld(playerid);
TogglePlayerControllable(playerid,false);
WithWeap[playerid] = 1;
}
return 1;
}
YCMD:startevent(playerid,params[],help)
{
#pragma unused help
#pragma unused params
if(!IsPlayerAdmin(playerid)) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"RCON adminnak kell lenned!\");
new exist[32],string[256],e[2];
for(new i = 1; i <= MAX_EVENTS; i++)
{
format(exist, sizeof(exist), EVENT_FILE, i);
if(fexist(exist))
{
new a[12];
valstr(a, i);
strcat(string, a);
strcat(string, \") ID: \");
format(e,2,\"%d\",i);
strcat(string, e);
strcat(string, \" | \");
strcat(string, Event[Name]);
strcat(string, \"\\n\");
}
}
ShowPlayerDialog(playerid,DIALOG_EVENT+4,DIALOG_STYLE_INPUT,\"Események\",string,\"Indít\",\"Mégse\");
return 1;
}
stock GetName(playerid)
{
new
pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
return pName;
}
//Load
forward LoadEvent(id, name[], value[]);
public LoadEvent(id, name[], value[])
{
new string[6];
INI_String(\"Name\", Event[id][Name],64);
INI_Float(\"TCPX\", Event[id][TCPX]);
INI_Float(\"TCPY\", Event[id][TCPY]);
INI_Float(\"TCPZ\", Event[id][TCPZ]);
INI_Float(\"TCPA\", Event[id][TCPA]);
INI_Int(\"Veh\", Event[id][VehID]);
INI_Int(\"Weapon\", Event[id][WeapID]);
for(new i = 2;i <= MAX_CP;i++)
{
format(string,6,\"CPX%d\",i);
INI_Float(string, CheckPoint[id][CPX]);
format(string,6,\"CPY%d\",i);
INI_Float(string, CheckPoint[id][CPY]);
format(string,6,\"CPZ%d\",i);
INI_Float(string, CheckPoint[id][CPZ]);
}
INI_Int(\"MaxCP\", Event[id][MaxCP]);
return 1;
}
forward Time();
public Time()
{
foreach(Player, i)
{
if(PlayerCP > 0 && StartedEventTime == 0)
{
PlayerTime++;
new Min=floatround(PlayerTime/60);
new Sec=PlayerTime-(Min*60);
new string[128];
format(string,sizeof(string),\"Idõ: %02d:%02d~n~CP: ~r~%d/%d\",Min,Sec,PlayerCP-1,Event[startedEvent][MaxCP]);
TextDrawSetString(Event0,string);
}
}
}