Jump to content
  • 0

pomoc [HELP] FS ... Arena


Eroor

Dotaz

Dobrý den.

Zrobil som malú DM arénu ... viem tie príkazy sa vám zdaju úplne na H.... 

No som začiatočník a stači mi tO :)

Chcel som vám to dať len skontrolovať, pretože buď mi blbne Local server na SAMPE ... alebo neviem ... pise ze unknown command ...

#include <a_samp>
#include <string>
#include <zcmd>                        

#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

public OnFilterScriptInit()
{
    CreateObject(13623, 2701.69995, 645.20001, 23.4, 0, 0, 0);
    CreateObject(981, 2723.3999, 657, 9.8, 0, 0, 0);
    CreateObject(981, 2681.1001, 631.90002, 9.8, 0, 0, 0);
    CreateObject(1237, 2717.5, 647.40002, 9.8, 0, 0, 0);
    CreateObject(1237, 2691.3999, 663.5, 9.8, 0, 0, 0);
    CreateObject(1237, 2707.5, 624.19922, 9.8, 0, 0, 0);
    CreateObject(1237, 2713, 664.59998, 9.8, 0, 0, 0);
    CreateObject(1237, 2682.3999, 645, 9.8, 0, 0, 0);
    CreateObject(1410, 2696.1001, 648.5, 10.6, 0, 0, 0);
    CreateObject(1410, 2704, 647.89941, 10.6, 0, 0, 0);
    CreateObject(1410, 2712, 648, 10.6, 0, 0, 0);
    CreateObject(1422, 2708, 647.5, 10.2, 0, 0, 0);
    CreateObject(1422, 2700.1001, 647.90002, 10.2, 0, 0, 0);
    CreateObject(2755, 2677.6001, 631.70001, 11.6, 0, 0, 0);
    CreateObject(2755, 2727.09961, 657.19922, 11.6, 0, 0, 0);
    CreateObject(7033, 2690.6001, 666.59998, 14.3, 0, 0, 0);
    CreateObject(7033, 2714, 634.7998, 14.3, 0, 0, 0);
    CreateObject(1572, 2678.8999, 639.20001, 10.4, 0, 0, 0);
    CreateObject(1572, 2701.3999, 654.20001, 10.4, 0, 0, 0);
    CreateObject(1572, 2673.5, 648.40002, 10.4, 0, 0, 0);
    CreateObject(1572, 2710, 617.09998, 10.4, 0, 0, 0);
    CreateObject(16101, 2736.69995, 660.29999, 9.9, 0, 0, 0);
    CreateObject(2774, 2720.19995, 671.90002, 22.9, 0, 0, 0);
    CreateObject(2774, 2716.2998, 614.19922, 22.9, 0, 0, 0);
    CreateObject(3666, 2734.5, 640, 10.4, 0, 0, 0);
    CreateObject(3666, 2722.3999, 648.40002, 10.4, 0, 0, 0);
    CreateObject(3666, 2674.69922, 648.2998, 10.3, 0, 0, 0);
    CreateObject(3666, 2700.7998, 610.19922, 10.3, 0, 0, 0);
    CreateObject(3666, 2725.59961, 615.69922, 10.5, 0, 0, 0);
    CreateObject(3666, 2717.39941, 636.89941, 10.3, 0, 0, 0);
    CreateObject(3666, 2720.80005, 669, 10.3, 0, 0, 0);
    CreateObject(3666, 2697.69995, 667.09998, 10.3, 0, 0, 0);
    CreateObject(3666, 2700.8999, 681.29999, 10.3, 0, 0, 0);
    CreateObject(3666, 2677.1001, 635.59998, 10.3, 0, 0, 0);
    CreateObject(3666, 2729.30005, 660.79999, 10.4, 0, 0, 0);
    CreateObject(13367, 2735.30005, 650.09998, 21.9, 0, 0, 0);
    CreateObject(14873, 2719.1001, 652.59998, 10.6, 0, 0, 0);
    CreateObject(14873, 2676.80005, 640, 10.6, 0, 0, 0);
    CreateObject(1454, 2698.5, 629.5, 10.6, 0, 0, 0);
    CreateObject(3666, 2687.80005, 679.40002, 10.3, 0, 0, 0);
    CreateObject(3666, 2712.6001, 682, 10.3, 0, 0, 0);
    CreateObject(624, 2717.5, 674, 9.8, 0, 0, 0);
    CreateObject(624, 2734.09961, 636.09961, 10.9, 0, 0, 0);
    CreateObject(624, 2668.5, 654.39941, 9.8, 0, 0, 0);
    CreateObject(624, 2707.5, 615.5, 9.8, 0, 0, 0);
    CreateObject(624, 2683.7998, 677.89941, 9.8, 0, 0, 0);
    CreateObject(624, 2692.5, 642.09961, 9.8, 0, 0, 0);
    CreateObject(624, 2684.09961, 617.39941, 9.1, 0, 0, 0);
    CreateObject(624, 2708.3999, 652.90002, 9.8, 0, 0, 0);
    CreateObject(624, 2701.3999, 681, 9.8, 0, 0, 0);
	return 1;
}

CMD:ajoin(playerid, params[])
	{
        new string[256];
        ResetPlayerWeapons(playerid);
		SendClientMessage(playerid, 0x80FF00FF, "===============================/ARENA/===============================");
		GivePlayerWeapon(playerid, 9, 1);
		SetPlayerHealth(playerid, 100.0);
		SetPlayerArmour(playerid, 100.0);
		TogglePlayerControllable(playerid, 0);
		SendClientMessage(playerid, 0x0080FFFF, "{FF0000}[ ARENA ] {0080FF}Cakanie na ostatních hráčov...");
		SendClientMessage(playerid, 0xFF8040FF, "{FF0000}[ ! ] {FF8040}Pripojil si sa do {FF0000}Gliadiator {FF8040}areny!");
		SendClientMessage(playerid, 0x80FF00FF, "===============================/GLADIATORS/===============================");
		format(string, sizeof(string), "{FF0000}[ ARENA ] {00FFFF}Hráč {00FFFF}%s {00FFFF}sa pripojil do arény !   {80FF00}[ /ajoin] !", PlayerName(playerid));
        SendClientMessageToAll(0x00FFFFFF, string);
		new warp;
		warp = random(7);
		switch(warp)
		{
		case 0: SetPlayerPos(playerid, 1736.3724,10.8203,348.6855);
		case 1: SetPlayerPos(playerid, 1753.8733,10.8203,123.7334);
		case 2: SetPlayerPos(playerid, 1767.3987,10.8249,220.8676);
		case 3: SetPlayerPos(playerid, 1765.9956,10.8034,174.8072);
		case 4: SetPlayerPos(playerid, 1735.0403,10.8203,57.3061);
		case 5: SetPlayerPos(playerid, 1742.0729,10.8203,328.0052);
		case 6: SetPlayerPos(playerid, 1730.4282,10.8203,35.0592);
        }
		return 1;
}
CMD:astart(playerid, params[])
	{
		new string[256];
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000FF,"Niesi prihlaseny cez RCON!");
        format(string, sizeof(string), "{FF0000}[ ARENA ] {00FFFF}Administrátor {80FFFF}%s {00FFFF}odštartoval súboj v Gladiátor aréne !", PlayerName(playerid));
        SendClientMessageToAll(-1, string);
        for(new i=0;i<=MAX_PLAYERS;i++)
	    {
		TogglePlayerControllable(i, 1);
	    }
	    return 1;
	}
CMD:ap(playerid, params[])
	{
		if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000FF,"{FF0000}[ ARENA ] {0080FF}Niesi prihlaseny za {FF0000}RCON!");
        SendClientMessageToAll(0xFFFF00FF, "{FF0000}[ ARENA ] {80FFFF}Začal sa súboj v arénach ! Pripoj sa pomocou {FF0000}/ajoin");
		return 1;
}

stock PlayerName(playerid)
{
  new name[255];
  GetPlayerName(playerid, name, 255);
  return name;
}

Link to comment
Share on other sites

3 odpovědí na tuto otázku

Recommended Posts

  • 0

Nepoznám dcmd, ale zdá sa mi, že musíš ešte do OnPlayerCommandText každý z tých príkazov zapísať.
V zcmd nemusíš.
Tie stringy nemusíš definovať na počet znakov 256, to je zbytočne vela.
Dúfam, že to tabovanie a medzery ti rozhádzalo fórum a nie, že to tak máš v kóde ;).
Máš tam pár zbytočných riadkov

#include <zcmd>
#include <string>

a pár chybičiek

for(new i=0;i<=MAX_PLAYERS;i++) /* ma byt i < MAX_PLAYERS */
Edited by Tango
Link to comment
Share on other sites

  • 0

jj rozhadzalo mi to tu :Da toto čo si povedal som opravil a zcmd pouzivam lebo to je kratsie

 

 

A už to ide ... ale problém je v tom , že ked napisem to /astart tak ma to da len niekde do vzduchu  a nie do tej areny

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...