Why isnt this working?
#1

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

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;
}
Reply
#2

now it doesnt end the event
Reply
#3

Quote:
Originally Posted by belhot1992
Посмотреть сообщение
Did you enter the name of the event as well?
/endevent nameofevent

EDIT:
I updated my code by the way.
the way the code is now i can type the name to end. But ur code is nice cuz you have to put name so it wont be blank thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)