Jump to content

Cerere tutorial simplu


SebyGTA

Recommended Posts

vreau sa vad comanda de la /dmevent

​    if(strcmp(cmd, "/dmevent", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pHelper] >=1 && IsDM == 0 || PlayerInfo[playerid][pAdmin] >= 1 && IsDM == 0)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "{FF6699}USAGE:{FFFFFF} /dmevent (prize - minim $50,000)");
                    return 1;
                }
                new prize;
                prize = strval(tmp);
                if(prize < 50000)
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "Suma trebuie sa fie mai mare de $50,000!");
                    return 1;
                }
                if(prize >= 100001)
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "Suma trebuie sa fie mai mica de $100,000!");
                    return 1;
                }
                if(GetPlayerMoney(playerid) < prize)
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "Nu ai suficienti bani pentru a incepe eventul!");
                    return 1;
                }
                DMPrize = prize;
                IsDM = 1;
                SendClientMessageToAll(0xFFA500AA,"{FFA500}==================={FF0000} [Event] {FFA500}===================");
                SendClientMessageToAll(0xCCCCCCC,"{CCCCCC}Event:{E0FFFF} DeathMatch!");
                format(string, sizeof(string), "{CCCCCC}Organizator: {FFA500}%s", PlayerName(playerid));
                SendClientMessageToAll(0xCCCCCFF, string);
                format(string, sizeof(string), "{CCCCCC}Premiu: {66FF66}$%s", FormatMoney(prize));
                SendClientMessageToAll(0xCCCCCFF, string);
                SendClientMessageToAll(0xCCCCCFF,"{CCCCCC}Timp:{E0FFFF} Se termina automat in 6 Minute!");
                SendClientMessageToAll(0xCCCCCFF,"{CCCCCC}Pentru inscriere tastati{E0FFFF} /joindmevent!");
                SendClientMessageToAll(0xFFA500AA,"{FFA500}==================={FF0000} [Event] {FFA500}===================");
                SetTimer("EndDmEvent", 360000, 0);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "{CCCCCC} * Nu esti autorizat sa folosesti aceasta comanda.");
            }
        }
        return 1;
    }

 

si /joindmevent

    if(strcmp(cmd, "/joindmevent", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (IsDM == 1)
            {
                if (GetPlayerState(playerid) == 2)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "   Get out of your vehicle, and try again.");
                    return 1;
                }
                if (PlayerInfo[playerid][pInDM] == 1)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "Esti deja in Event!");
                    return 1;
                }
                if(PlayerInfo[playerid][pJailed] == 1)
                {
                    SendClientMessage(playerid,COLOR_GREY,"   You can't use this command, you are in jail!");
                    return 1;
                }
                if(WantedLevel[playerid] >= 1)
                {
                    SendClientMessage(playerid,COLOR_GREY,"   You can't use this command, you are currently Wanted!");
                    return 1;
                }
                if(PlayerTied[playerid] > 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "  You can't use this command because you are tied!");
                    return 1;
                }
                new rand = random(sizeof(DMSpawns));
                SetPlayerPos(playerid, DMSpawns[rand][0], DMSpawns[rand][1], DMSpawns[rand][2]);
                SetPlayerFacingAngle(playerid, DMSpawns[rand][3]);
                SendClientMessage(playerid, COLOR_GRAD1, "{CCCCCC}Ai fost teleportat la {FFFFFF}DeathMatch Event!");
                SendClientMessage(playerid, COLOR_GRAD1, "{CCCCCC}Pentru a parasi Eventul, tasteazã {FFFFFF}[/leaveevent]");
                SetPlayerInterior(playerid,0);
                PlayerInfo[playerid][pInDM] = 1;
                PlayerInfo[playerid][pInt] = 0;
                SetPlayerVirtualWorld(playerid,20);
                PlayerInfo[playerid][pVirWorld] = 20;
                ResetPlayerWeapons(playerid);
                GivePlayerWeapon(playerid, 25, 999);
                GivePlayerWeapon(playerid, 24, 999);
                GivePlayerWeapon(playerid, 29, 999);
                GivePlayerWeapon(playerid, 31, 999);
                GivePlayerWeapon(playerid, 16, 1);
                SetPlayerHealth(playerid, 100);
                SetPlayerArmour(playerid, 100);
                SetPlayerColor(playerid,0x48D1CCAA);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   The DeathMatch Event is not activated at this time!");
            }
        }
        return 1;
    }

Edited by SebyGTA
Link to comment
Share on other sites

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.