SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 03/04/2011, 09:14 AM   #1
Snowman12
Huge Clucker
 
Join Date: Jan 2011
Location: Nottingham, UK.
Posts: 450
Reputation: 23
Default How to make /event start an actual event

Hay i have /start event and / sop event and / lock event but they dont load a mini game but keep the normal game mode running heres what i have

pawn Code:
if(strcmp(cmd, "/startevent", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 5 && (!EventStarted))
            {
                EventStarted = 1;
                EventLocked = 0;
                GetPlayerPos(playerid,ex,ey,ez);
                GetPlayerVirtualWorld(playerid);
                GetPlayerInterior(playerid);
                BroadCast(COLOR_LIGHTBLUE, "** Notice: An Event has started, use /joinevent.");
            }
            else if (PlayerInfo[playerid][pAdmin] >= 5 && (EventStarted))
            {
                EventStarted = 0;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/joinevent", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(EventStarted == 0)
            {
                  SendClientMessage(playerid, COLOR_LIGHTBLUE, " ** An Event has not Started.");
                  return 1;
            }
            else if(EventLocked == 1)
            {
                  SendClientMessage(playerid, COLOR_RED, "** The event is locked.");
                  return 1;
            }
            new EJoin = strval(tmp);
            new vw = GetPlayerVirtualWorld(playerid);
            SetPlayerPos(playerid,ex,ey,ez);
            SetPlayerVirtualWorld(playerid,vw);
            SetPlayerInterior(playerid,EventInfo[EJoin][EInterior]);
            PlayerInfo[playerid][pInt] = EventInfo[EJoin][EInterior];
        }
        return 1;
    }
    if(strcmp(cmd, "/lockevent", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 5)
            {
                EventLocked = 1;
                BroadCast(COLOR_YELLOW, "** Notice: The event has been locked by a Admin **");
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
            }
        }
        return 1;
    }

Could i edit this one or somthing so if i do /startevent 1 it loads the event ive named 1 or /startevent name of event ive seen this on other servers but i have no idea of how to do it with out switching gamemodes and i cant switch gamemodes because i need the rp script to still run so i might need to go if respone the the differnt things to load game modes im not sure #
__________________
I must apologize, I'm very sorry for being random.

Show your support by stopping this immature user "Brian_G" from stealing images from me/and others by leaving this on your signature.
Snowman12 is offline  
Old 03/04/2011, 09:36 AM   #2
Max_Coldheart
Guest
 
Posts: n/a
Default Re: How to make /event start an actual event

Yes, it is possible.
 
Old 03/04/2011, 09:53 AM   #3
Snowman12
Huge Clucker
 
Join Date: Jan 2011
Location: Nottingham, UK.
Posts: 450
Reputation: 23
Default Re: How to make /event start an actual event

Ye but how can i do it?
__________________
I must apologize, I'm very sorry for being random.

Show your support by stopping this immature user "Brian_G" from stealing images from me/and others by leaving this on your signature.
Snowman12 is offline  
Old 03/04/2011, 09:55 AM   #4
Max_Coldheart
Guest
 
Posts: n/a
Default Re: How to make /event start an actual event

I would suggesst you to use sscanf and zcmd for that.
 
Old 03/04/2011, 10:08 AM   #5
Snowman12
Huge Clucker
 
Join Date: Jan 2011
Location: Nottingham, UK.
Posts: 450
Reputation: 23
Default Re: How to make /event start an actual event

i know how to do comands i want to load the event but not close currant GM
__________________
I must apologize, I'm very sorry for being random.

Show your support by stopping this immature user "Brian_G" from stealing images from me/and others by leaving this on your signature.
Snowman12 is offline  
Old 03/04/2011, 10:13 AM   #6
Max_Coldheart
Guest
 
Posts: n/a
Default Re: How to make /event start an actual event

so you want to load filterscript while gamemode is still running?
 
Old 03/04/2011, 10:21 AM   #7
xir
Gangsta
 
Join Date: Aug 2010
Posts: 746
Reputation: 0
Default Re: How to make /event start an actual event

I dont get you very well, but something like this?

pawn Code:
new Events;
new Float:Event[3];

COMMAND:startevent(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 5)
    {
        BroadCast(COLOR_LIGHTBLUE, "** Notice: An Event has started, use /joinevent.");
        if(Events == 1) return SendClientMessage(playerid,-1,"There is already an event created");
        GetPlayerPos(playerid,Float:Event[0],Float:Event[1],Float:Event[2]);
        Events = 1;
    } else if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
    return 1;
}
COMMAND:joinevent(playerid, params[])
{
    if(Events == 0) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "An Event has not Started.");
    SetPlayerPos(playerid,Float:Event[0],Float:Event[1],Float:Event[2]);
    return 1;
}
COMMAND:lockevent(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 5)
    {
        BroadCast(COLOR_YELLOW, "** Notice: The event has been locked by a Admin **");
        if(Events == 0) return SendClientMessage(playerid, Red, "No event has been created");
        Events = 0;
    } else if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
    return 1;
}

Convert to strcmp if you want
xir is offline  
Old 03/04/2011, 11:39 PM   #8
Snowman12
Huge Clucker
 
Join Date: Jan 2011
Location: Nottingham, UK.
Posts: 450
Reputation: 23
Default Re: How to make /event start an actual event

sorry for late reply n yh i can see where i can do it now and im thinking of doing it in dialog thanks mate
Snowman12 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Event Help! Hamudi_Chi Help Archive 1 18/12/2010 03:56 PM
[HELP] /event Capitan_Price Help Archive 5 06/09/2010 05:25 PM
Event! ColdXX Help Archive 5 29/05/2010 01:35 PM
help on event [SF]RobMob Help Archive 1 12/03/2010 10:46 AM


All times are GMT. The time now is 02:47 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.