Make event
#1

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

whats the problem?
Reply
#3

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

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

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

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

Edited mine, it should work now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)