05.12.2012, 14:22
(
Последний раз редактировалось Buzzbomb; 19.12.2012 в 12:46.
)
I type /startevent 25 ihopeitworks It shows the dialog and The counter works cause i have it call on something at the end.. well it shows ihopeitworks 53 and it doesnt change.. any Ideals?
Any Suggestions Please Comment.. Thanks A Million..
pawn Код:
#include <a_samp>
#include <zcmd>
#define BLUE 0x000FFFFF
#define ORANGE 0xFF7800FF
#define WARNING 0x00FFFFFF
forward StartRandomEvent();
forward RandomEvent1(playerid);
forward RandomEvent2(playerid);
new seconds;
new ETimer;
new Text:EventDraw[MAX_PLAYERS] = Text:INVALID_TEXT_DRAW;
new TimerShowing[MAX_PLAYERS];
new EventTimer;
new RandomEvent[][] =
{
"RandomEvent1",
"RandomEvent2"
};
public OnFilterScriptInit()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
EventDraw[i] = TextDrawCreate(1.000000, 426.000000, " ");
TextDrawBackgroundColor(EventDraw[i], 65535);
TextDrawFont(EventDraw[i], 1);
TextDrawLetterSize(EventDraw[i], 0.500000, 1.000000);
TextDrawColor(EventDraw[i], 16777215);
TextDrawSetOutline(EventDraw[i], 1);
TextDrawSetProportional(EventDraw[i], 1);
TextDrawUseBox(EventDraw[i], 1);
TextDrawBoxColor(EventDraw[i], 255);
TextDrawTextSize(EventDraw[i], 639.000000, 0.000000);
}
//EventTimer = SetTimer("StartRandomEvent",5000,true);
return 1;
}
CMD:startevent(playerid,params[])
{
new eventname[128],Estring[256],tstr[5];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(TimerShowing[i] == 1)
{
// EventTimer = SetTimer("StartRandomEvent",150000,true);
TimerShowing[i] = 0;
TextDrawHideForPlayer(i, EventDraw[i]);
}
else
{
if(sscanf(params, "ds",seconds,eventname)) return SendClientMessage(playerid, WARNING, "/startevent time discription ");
if(seconds < 1 || seconds > 1000000) return SendClientMessage(playerid, WARNING, "Allowed Eventimes Seconds 1-1000000");
ETimer = SetTimerEx("RandomEvent1",seconds*1000, false,"i", i); // Set a repeated timer of 1000 miliseconds (1 second)
KillTimer(EventTimer);
format(tstr,sizeof(tstr),"%d",ETimer);
format(Estring,sizeof(Estring),"Event: %s Starts in: %d Seconds",eventname,tstr);
TextDrawShowForPlayer(i, EventDraw[i]);
TextDrawSetString(EventDraw[i],Estring);
TimerShowing[playerid] = 1;
}
}
return 1;
}
CMD:eventhelp(playerid,params[])
{
SendClientMessage(playerid, BLUE,"$$$$====$$$$====$$$$ Event $$$ Help $$$$====$$$$====$$$$");
SendClientMessage(playerid, ORANGE,"/startevent /stopevent ");
return 1;
}
public OnFilterScriptExit()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
TextDrawHideForAll(EventDraw[i]);
TextDrawDestroy(EventDraw[i]);
KillTimer(EventTimer);
}
return 1;
}
public StartRandomEvent()
{
new RandEvent = random(sizeof(RandomEvent));
SetTimer(RandomEvent[RandEvent] ,5000,false);
return 1;
}
public RandomEvent1(playerid)
{
new msg[64];
for(new i; i < MAX_PLAYERS; i++)
{
format(msg,sizeof(msg),"~g~IT ~b~WORKED");
GameTextForAll(msg,5000,3);
TextDrawHideForAll(EventDraw[i]);
//TextDrawDestroy(EventDraw[i]);
KillTimer(ETimer);
}
KillTimer(EventTimer);
return 1;
}
public RandomEvent2(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
}
KillTimer(EventTimer);
return 1;
}