Jump to content
  • 0

Eroare comanda /oplace


danii.ws

Question

Problema intalnita (descriere):Imi da eroare cand salvez
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul(obligatoriu):
Imagini / Video (optional):
Ati incercat sa rezolvati singur?: da.

Imi da eroare cand salvez

CMD:oplace(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new Float:X, Float:Y, Float:Z, Obiect;
        if(sscanf(params, "dd", Obiect, OValoare)) return SendClientMessage(playerid, COLOR_GREY, "{CECECE}Syntax:{FFFFFF} /oplace [obiect default 19042] [valoare]");
       GetPlayerPos(playerid, X, Y, Z);
        OPickup = CreatePickup(obiect, 1, X, Y, Z, -1);
        OPremii++;
        PlayerInfo[playerid][pAdminPoints]++;
        Update(playerid, pAdminPointsz);
        format(gString, sizeof(gString), "Admin %s started an event. Object: %d, prize: %d", GetName(playerid), Obiect, OValoare);
        ABroadCast(COLOR_DARKRED, 1, gString);
    }
    return 1;
}

new: new OPremii,
    OValoare,
    OPickup;

 

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == OPickup)
    {
        if(OPremii < 1)
        {
            format(gString, sizeof(gString), "AdmBot: %s a gasit un cadou si a primit premiul in valoare de %d", GetName(playerid), OValoare);
            SendClientMessageToAll(COLOR_NEWS, gString);
            format(gString, sizeof(gString), "AdmBot: Nu mai e niciun cadou de gasit. Multumim de participare!");
            SendClientMessageToAll(COLOR_NEWS, gString);
            format(gString, sizeof(gString), "(!) Felicitari! Ai gasit premiul in valoare de %d!", OValoare);
            SendClientMessageToAll(COLOR_ERROR, gString);
            GivePlayerCash(playerid, OValoare);
            DestroyPickup(OPickup);
        }
        else if(OPremii > 1)
        {
            OPremii--;
            format(gString, sizeof(gString), "AdmBot: %s a gasit un cadou si a primit premiul in valoare de %d", GetName(playerid), OValoare);
            SendClientMessageToAll(COLOR_NEWS, gString);
            format(gString, sizeof(gString), "AdmBot: Mai sunt %d cadouri de gasit!", OPremii);
            SendClientMessageToAll(COLOR_NEWS, gString);
            format(gString, sizeof(gString), "(!) Felicitari! Ai gasit premiul in valoare de %d!", OValoare);
            SendClientMessageToAll(COLOR_ERROR, gString);
            GivePlayerCash(playerid, OValoare);
        }
    }
    return 1;
}
Edited by danii.ws
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • 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.