SA-MP Forums Archive
Make event - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Make event (/showthread.php?tid=349184)



Make event - HighPitchedVoice - 08.06.2012

The cmd still ResetPlayerWeapons

pawn Code:
YCMD:makeevent(playerid, params[], help)
    {
        new str[128];
        if(PlayerInfo[playerid][pAdmin] < 5 && !IsPlayerAdmin(playerid)) return
        {
            ResetPlayerWeapons(playerid);
            format(str,sizeof(str),"{FF7F00}%s has made a event, type /joinevent to join the event.", GetName(playerid));
            SendClientMessageToAll(-1,str);
            ResetPlayerWeapons(playerid);
            SetPlayerPos(playerid, 1798.2366,-1303.9529,120.2656);
            GivePlayerWeapon(playerid, 24, 200);
            SetPlayerArmour(playerid, 100);
        }
        else
        {
            SendClientMessage(playerid, COLOR_ORANGE, "You are not enough high administrator level!");
        }
        return 1;
    }
It dosn't work correctly :P


Re: Make event - SnG.Scot_MisCuDI - 08.06.2012

whats the problem?


Re: Make event - HighPitchedVoice - 08.06.2012

It crashes and I don't know how to restrict it so only the administrator level 5 can do it..


Re: Make event - zxc1 - 08.06.2012

pawn Code:
YCMD:makeevent(playerid, params[], help)
    {
        new str[128];
        if(PlayerInfo[playerid][pAdmin] >= 5 && IsPlayerAdmin(playerid))
        {
            ResetPlayerWeapons(playerid);
            format(str,sizeof(str),"{FF7F00}%s has made a event, type /joinevent to join the event.", GetName(playerid));
            SendClientMessageToAll(-1,str);
            ResetPlayerWeapons(playerid);
            SetPlayerPos(playerid, 1798.2366,-1303.9529,120.2656);
            GivePlayerWeapon(playerid, 24, 200);
            SetPlayerArmour(playerid, 100);
        }
        else
        {
            SendClientMessage(playerid, COLOR_ORANGE, "You are not enough high administrator level!");
        }
        return 1;
    }



Re: Make event - HighPitchedVoice - 08.06.2012

(991) : error 029: invalid expression, assumed zero - "else" is the line


Re: Make event - leonardo1434 - 08.06.2012

It should be something like that, to close the event just set back the var eventopen to 0.

pawn Code:
new eventopen[MAX_PLAYERS] = 0;

YCMD:makeevent(playerid, params[], help)
{
    eventopen[playerid] = 1;
    new str[128];
    if(PlayerInfo[playerid][pAdmin] < 5 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You are not enough high administrator level!"; // in case he's not level 5 or not logged in on Rcon, Will be displayed this message.
    {
        format(str,sizeof(str),"{FF7F00}%s has made a event, type /joinevent to join the event.", GetName(playerid));
        SendClientMessageToAll(-1,str);
    }
    return 1;
}


YCMD:joinevent(playerid, params[]) // i've made this one, because it was useless at command to create the event.
{
    new str[128];
    if(eventopen[playerid] == 1)
    {
        ResetPlayerWeapons(playerid);
        SetPlayerPos(playerid, 1798.2366,-1303.9529,120.2656);
        GivePlayerWeapon(playerid, 24, 200);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        format(str,sizeof(str),"{FF7F00}%s joined in the event !", GetName(playerid));
        SendClientMessageToAll(-1,str);
    }
}



Re: Make event - zxc1 - 08.06.2012

Edited mine, it should work now.