03.04.2011, 09:14
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
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 #
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;
}