16.12.2011, 23:04
Im having more issues with event script. When you /event [name] it says
[NAME] EVENT HAS STARTED
But when i /endevent it say
____ HAS ENDED
It doesnt say the event name when i do /endevent
[NAME] EVENT HAS STARTED
But when i /endevent it say
____ HAS ENDED
It doesnt say the event name when i do /endevent
pawn Код:
CMD:event(playerid, params[])
{
if(!IsPlayerLuxAdmin(playerid))
{
return SendClientMessage(playerid, -1, "SERVER: Unknown Command.");
}
else
{
new string[120]; new pname[24]; GetPlayerName(playerid, pname, 24);
new Index;
new tmp[256]; tmp = strtok(params, Index);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetGVarFloat("EventX", x); SetGVarFloat("EventY", y); SetGVarFloat("EventZ", z); SetGVarInt("EventI", GetPlayerInterior(playerid)); SetGVarInt("EventStarted", 1);
format(string, 120, "~w~%s Has Started. ~n~Type ~r~/yes ~w~to join.",tmp);
GameTextForAll(string, 6000, 3);
SendClientMessage(playerid, COLOR_GREEN, "You have started an event. Type /endevent to end it.");
}
return 1;
}
CMD:endevent(playerid, params[])
{
if(!IsPlayerLuxAdmin(playerid))
{
return SendClientMessage(playerid, -1, "SERVER: Unknown Command.");
}
else
{
new pname[24]; new string[120]; GetPlayerName(playerid, pname, 24);
new Index;
new tmp[256]; tmp = strtok(params, Index);
if(GetGVarInt("EventStarted") == 0) return SendClientMessage(playerid, red, "There's no event started.");
SetGVarInt("EventStarted", 0);
format(string, 120, "~w~%s Has ~r~ended. ~w~~n~You can no longer join.",tmp);
GameTextForAll(string, 6000, 3);
}
return 1;
}