Jump to content
  • 0

Problema comanda /oplace


Cordyandrey

Question

Salut, folosesc /oplace ok pun cadoul si cand intra un civil in el apare asta.. apoi zice comanda nu exsita cand incerc sa pun iar, stie cineva de ce?

Poza:

https://imgur.com/a/adGo1Jl

Code:



CMD:oplace(playerid, params[]) {
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_LIGHTGREEN3, AdminOnly);
    if(eventobjects > 9) return SCM(playerid,COLOR_WHITE,"You can't place more than 10 objects.");
    new objectid,prize,sendername[30],Float:pX,Float:pY,Float:pZ,string[128];
    if(sscanf(params, "dd",objectid,prize))
    {
        SendClientMessage(playerid, COLOR_WHITE,"{008080}Usage: {FFFFFF}/oplace <ObjectID> <Prize>");
        SendClientMessage(playerid, COLOR_WHITE,"[OBJECTS] Cadou: 19054 - 19058 | Glob craciun: 19059 - 19063 | Oua paste: 19341 - 19345");
        return 1;
    }
    if(prize < 1 || prize > 10000000) return SendClientMessage(playerid, COLOR_WHITE, "Prize must be between $1 and $10,000,000.");
    GetPlayerName(playerid, sendername, sizeof(sendername));
    GetPlayerPos(playerid,pX,pY,pZ);
    eventobjects++;
    objectevent[eventobjects] = CreatePickup(objectid, 1, pX+2,pY,pZ, -1);
    eventprizeobj[eventobjects] = prize;
    format(string,sizeof(string),"Admin %s[admin:%d] started an event. Object: %d, prize: $%s.",sendername,PlayerInfo[playerid][pSQLID],objectid,FormatNumber(prize));
    ABroadCast(COLOR_RED2, string,1);
    Adminlog(string);
    return 1;
}

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0



function OnPlayerPickUpPickup(playerid, pickupid) {
    if(eventobjects > 0)
    {
        if(PlayerInfo[playerid][pAdmin] < 1)
        {
            for(new obj; obj < 11; obj++)
            {
                if(pickupid == objectevent[obj])
                {
                    eventobjects--;
                    new string[128],name[30];
                    GetPlayerName(playerid, name, sizeof(name));
                    GivePlayerCash(playerid, eventprizeobj[obj]);
                    Update(playerid,pCashx);
                    DestroyPickup(objectevent[obj]);
                    format(string,sizeof(string),"NR AdmBot: Un obiect din event a fost gasit de %s. Acesta a castigat un premiu de $%s!",name,FormatNumber(eventprizeobj[obj]));
                    OOCNews(COLOR_ORANGE,string);
                    if(eventobjects > 0)
                    {
                        format(string,sizeof(string),"NR AdmBot: Eventul continua. Mai sunt %d obiecte de gasit!",eventobjects);
                    }
                    else
                    {
                        format(string,sizeof(string),"NR AdmBot: Eventul a luat sfarsit. Multumim pentru participare!");
                    }
                    OOCNews(COLOR_ORANGE,string);
                    objectevent[obj] = 0;
                    eventprizeobj[obj] = 0;
                }
            }
        }
    }
    return 1;
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.