Peršokti į turinį
  • ŽAIDIMAI
  • , ŽAIDIMAI
  • ŽAIDIMAI

Ši tema yra neaktyvi. Paskutinis pranešimas šioje temoje buvo prieš 4872 dienas (-ų). Patariame sukurti naują temą, o ne rašyti naują pranešimą.

Už neaktyvių temų prikėlimą galite sulaukti įspėjimo ir pranešimo pašalinimo!

Recommended Posts

Labas vakaras chiebra, noriu duoti jum pamoką kaip sukurti baro sistema įdomia su npc botais

[YouTubeCom]

[/YouTubeCom] cia video kaip ji veikia

Taigi pradedam:

Dedam sita koda po OnPlayerText:

	new bot = GetClosestPlayer(playerid);
if(IsPlayerNPC(bot))
{
		if(BarGirlBusy == 1) return SendClientMessage(playerid,0xFFFF00DD,"Barmene:{FFFFFF}Palauk að uþsiemus!");
	if(!strcmp(GetPlayerNameEx(bot),"Barmene",true))
    	{
		if(!strcmp(text,"alaus",true))
     		{
       		BarGirlBusy = 1;
         		PlayerOrder[playerid] = "beer";
         		SetPlayerChatBubble(bot,"Uno momento graþuoli",0xFFFF00DD,35.0,3000);
      			ApplyAnimation(bot, "BAR","Barserve_bottle", 4.0, 0, 0, 0, 0, 0, 1);
      			SetTimerEx("GetBottle",3000,false,"ii",bot,playerid);
         	}
          	if(!strcmp(text,"sampano",true))
           {
            BarGirlBusy = 1;
            PlayerOrder[playerid] = "shampagne";
            SetPlayerChatBubble(bot,"Tuoj bus tavo ðampes bonka",0xFFFF00DD,35.0,3000);
            ApplyAnimation(bot, "BAR","Barserve_bottle", 4.0, 0, 0, 0, 0, 0, 1);
            SetTimerEx("GetBottle",3000,false,"ii",bot,playerid);
           }
           if(!strcmp(text,"vyno",true))
           {
           	BarGirlBusy = 1;
            	PlayerOrder[playerid] = "wine";
             	SetPlayerChatBubble(bot,"Duosiu vieno ið geriausiø vynø",0xFFFF00DD,35.0,3000);
              	ApplyAnimation(bot, "BAR","Barserve_bottle", 4.0, 0, 0, 0, 0, 0, 1);
               SetTimerEx("GetBottle",3000,false,"ii",bot,playerid);
		}
  			if(!strcmp(text,"baltos",true))
     		{
       		BarGirlBusy = 1;
         		PlayerOrder[playerid] = "vodka";
           	SetPlayerChatBubble(bot,"Tuojaus duosiu, gal pakviesi kartu iðgert?",0xFFFF00DD,35.0,3000);
            	ApplyAnimation(bot, "BAR","Barserve_bottle", 4.0, 0, 0, 0, 0, 0, 1);
             	SetTimerEx("GetBottle",3000,false,"ii",bot,playerid);
		}
			if(!strcmp(text,"fantos",true))
   		{
     			BarGirlBusy = 1;
        		PlayerOrder[playerid] = "sprunk";
          		SetPlayerChatBubble(bot,"Tuoj bus ta tavo fanta",0xFFFF00DD,35.0,3000);
          		ApplyAnimation(bot, "BAR","Barserve_bottle", 4.0, 0, 0, 0, 0, 0, 1);
            	SetTimerEx("GetBottle",3000,false,"ii",bot,playerid);
		}
	}
 	}

Apacioje savo gm dedam:

forward GetBottle(bot,playerid);
public GetBottle(bot,playerid)
{
if(!strcmp(PlayerOrder[playerid],"beer",true))
{
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
    GivePlayerMoneyEx(playerid, -6);
}
if(!strcmp(PlayerOrder[playerid],"shampagne",true))
{
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
    GivePlayerMoneyEx(playerid, -100);
}
if(!strcmp(PlayerOrder[playerid],"wine",true))
{
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
    GivePlayerMoneyEx(playerid, -50);
}
if(!strcmp(PlayerOrder[playerid],"vodka",true))
{
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
    GivePlayerMoneyEx(playerid, -70);
}
if(!strcmp(PlayerOrder[playerid],"sprunk",true))
{
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
    GivePlayerMoneyEx(playerid, -7);
}


   SetPlayerChatBubble(bot,"Kitas klientas gali prieiti!",0xFFFF00DD,35.0,3000);
  	ApplyAnimation(bot, "BAR","Barserve_give", 4.0, 0, 1, 1, 1, 0, 1);
  	BarGirlBusy = 0;
  	return 1;
}

Virsuje kodo:

new

BarGirlBusy,

PlayerOrder[MAX_PLAYERS][128];

OnGameModeInit dedam

ConnectNPC("barmene","barmene");

o jai grp tai data/init.txt

OnPlayerSpawn dedam:

new
    name[ MAX_PLAYER_NAME ];

GetPlayerName( playerid, name, MAX_PLAYER_NAME );
if ( IsPlayerNPC( playerid ) )
{
	if ( !strcmp( name, "Barmene", true ) )	// barmene
	{
	    SetPlayerInterior(playerid,11);
	    SetPlayerPos ( playerid, 499.7500,-77.5637,998.7651);
           SetPlayerFacingAngle	( playerid, 2.5822 );
		SetPlayerSkin		( playerid, 194 );
	}

http://www.solidfiles.com/d/0769216401/ - Nuoroda npc boto failui

Dažniausi klausymai:

1.Kodėl rašo ,kad botas prisijungia ir atsijungia prie serverio?

1.Susirandam registracijos vieta ir idedam sita koda if ( IsPlayerNPC( playerid ) ) return 1;

2.Kodėl botas iš viso nesijungia į servą?

2.Atsidarom server.cfg failą, ir maxnpc padarom 1 , čia priklauso nuo botų skaičiaus serve

jai ką klausiam chebra, žlugdau rpg-best :)

  • Teigiamai 4
  • Parašė po 7 mėnesių...
(redaguota)

Dėl ko metą tokius errorus dariau viską pagal pamoką:

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbp.pwn(1495) : error 029: invalid expression, assumed zero

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1495) : error 004: function "freez" is not implemented

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1500) : warning 225: unreachable code

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1500) : error 029: invalid expression, assumed zero

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1500) : error 004: function "OnPlayerDeath" is not implemented

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1502) : error 017: undefined symbol "killerid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tbggp.pwn(1504) : error 017: undefined symbol "killerid"

C:\Documents and Settings\user\Desktop\sampasTGP\gamemodes\tgp.pwn(1528) : error 017: undefined symbol "killerid"

C:\Documents and Settings\user\Desktop\sampas\T\gamemodes\tggbp.pwn(1538) : warning 225: unreachable code

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tbggp.pwn(1538) : error 029: invalid expression, assumed zero

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1538) : error 004: function "OnVehicleSpawn" is not implemented

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1540) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1543) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1547) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1550) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1551) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1552) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1553) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1554) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1557) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1563) : warning 225: unreachable code

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1563) : error 029: invalid expression, assumed zero

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1563) : error 004: function "OnVehicleDeath" is not implemented

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1565) : warning 219: local variable "playerid" shadows a variable at a preceding level

C:\Documents and Settings\user\Desktop\sampasT/gamemodes\tggbp.pwn(1567) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1569) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1569) : warning 215: expression has no effect

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1570) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1574) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1574) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\fggfpwn(1574) : warning 215: expression has no effect

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\fgfg.pwn(1575) : error 014: invalid statement; not in switch

Redaguota , nario KentFAN
(redaguota)

Dėl ko metą tokius errorus dariau viską pagal pamoką:

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbp.pwn(1495) : error 029: invalid expression, assumed zero

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1495) : error 004: function "freez" is not implemented

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1500) : warning 225: unreachable code

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1500) : error 029: invalid expression, assumed zero

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1500) : error 004: function "OnPlayerDeath" is not implemented

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1502) : error 017: undefined symbol "killerid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tbggp.pwn(1504) : error 017: undefined symbol "killerid"

C:\Documents and Settings\user\Desktop\sampasTGP\gamemodes\tgp.pwn(1528) : error 017: undefined symbol "killerid"

C:\Documents and Settings\user\Desktop\sampas\T\gamemodes\tggbp.pwn(1538) : warning 225: unreachable code

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tbggp.pwn(1538) : error 029: invalid expression, assumed zero

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1538) : error 004: function "OnVehicleSpawn" is not implemented

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1540) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1543) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1547) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1550) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1551) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1552) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1553) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1554) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1557) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1563) : warning 225: unreachable code

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1563) : error 029: invalid expression, assumed zero

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1563) : error 004: function "OnVehicleDeath" is not implemented

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1565) : warning 219: local variable "playerid" shadows a variable at a preceding level

C:\Documents and Settings\user\Desktop\sampasT/gamemodes\tggbp.pwn(1567) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1569) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1569) : warning 215: expression has no effect

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1570) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tggbp.pwn(1574) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\tgbgp.pwn(1574) : error 017: undefined symbol "vehicleid"

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\fggfpwn(1574) : warning 215: expression has no effect

C:\Documents and Settings\user\Desktop\sampasT\gamemodes\fgfg.pwn(1575) : error 014: invalid statement; not in switch

delete Redaguota , nario UseFuL.

Ši tema yra neaktyvi. Paskutinis pranešimas šioje temoje buvo prieš 4872 dienas (-ų). Patariame sukurti naują temą, o ne rašyti naują pranešimą.

Už neaktyvių temų prikėlimą galite sulaukti įspėjimo ir pranešimo pašalinimo!

Svečias
Ši tema yra užrakinta.
  • Šiame puslapyje naršo:   0 nariai

    • Nėra registruotų narių peržiūrinčių šį forumą.

Skelbimai


×
×
  • Sukurti naują...