Benalek 0 Odesláno: 16. Listopad, 2014 Share Odesláno: 16. Listopad, 2014 Ahoj, chtěl bych se zeptat jak se dá zjistit zda hráč míří na NPC. Já sem se to pokusil udělat takhle, ale ve výsledku se vubec nic nestalo: for(new npc=0; npc<MAX_NPCS; npc++) { new pizerov[MAX_PLAYER_NAME]; GetPlayerName(playerid, pizerov, sizeof(pizerov)); if(!strcmp(pizerov, "PizMen", true)) { if(IsPlayerConnected(GetPlayerTargetPlayer(npc))) { SendClientMessage(playerid,BILA,"Vyklrdal si pizerii"); }}} Link to comment Share on other sites More sharing options...
0 ReseT_ 0 Odesláno: 20. Listopad, 2014 Share Odesláno: 20. Listopad, 2014 Kam hráč mieri tuším ani nejde detekovať, len že kam strelí. Link to comment Share on other sites More sharing options...
0 Akai 1 Odesláno: 20. Listopad, 2014 Share Odesláno: 20. Listopad, 2014 Kam hráč mieri tuším ani nejde detekovať, len že kam strelí. GetPlayerTargetPlayer Link to comment Share on other sites More sharing options...
0 HellNoKitty 2 Odesláno: 20. Listopad, 2014 Share Odesláno: 20. Listopad, 2014 Co něco takovýho. new targetPlayer = GetPlayerTargetPlayer(playerid); new targetName[MAX_PLAYER_NAME]; GetPlayerName(targetPlayer, targetName, sizeof(targetName)); if(IsPlayerNPC(targetPlayer) && strcmp(targetName, "PizMan", true) == 0) SendClientMessage(playerid, BILA, "Vyklrdal si pizerii"); (Editnuto) Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 20. Listopad, 2014 Share Odesláno: 20. Listopad, 2014 Co něco takovýho. new targetPlayer = GetPlayerTargetPlayer(playerid); new targetName[MAX_PLAYER_NAME]; GetPlayerName(targetPlayer, targetName, sizeof(targetName)); if(targetPlayer != INVALID_PLAYER_ID && IsPlayerNPC(targetPlayer) && strcmp(targetName, "PizMan", true) == 0) SendClientMessage(playerid, BILA, "Vyklrdal si pizerii"); Dalo by se to detekovat i jen na IDčka takže žádne další podmínky bys ani nepotřeboval Link to comment Share on other sites More sharing options...
0 HellNoKitty 2 Odesláno: 20. Listopad, 2014 Share Odesláno: 20. Listopad, 2014 To NPC se může připojit pokaždý s jiným ID. Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 20. Listopad, 2014 Share Odesláno: 20. Listopad, 2014 To NPC se může připojit pokaždý s jiným ID. i tak by se to dalo udělat jen s jednou podmínkou Link to comment Share on other sites More sharing options...
0 HellNoKitty 2 Odesláno: 20. Listopad, 2014 Share Odesláno: 20. Listopad, 2014 Nedalo, když to kontroluješ podle jména, musíš mít ještě záruku, že je to NPC. Edit: Zbytečná je tam ta první část, ty dvě tam být musí. Link to comment Share on other sites More sharing options...
0 ATomas 289 Odesláno: 20. Listopad, 2014 Share Odesláno: 20. Listopad, 2014 To NPC se může připojit pokaždý s jiným ID. IsPlayerNPC Link to comment Share on other sites More sharing options...
0 HellNoKitty 2 Odesláno: 20. Listopad, 2014 Share Odesláno: 20. Listopad, 2014 IsPlayerNPC Pak to ale zase může být jiný NPC než od pizzy. Link to comment Share on other sites More sharing options...
0 ATomas 289 Odesláno: 20. Listopad, 2014 Share Odesláno: 20. Listopad, 2014 Pak to ale zase může být jiný NPC než od pizzy. Pak to jisti GetPlayerName Link to comment Share on other sites More sharing options...
0 HellNoKitty 2 Odesláno: 20. Listopad, 2014 Share Odesláno: 20. Listopad, 2014 Pak to jisti GetPlayerName "if(IsPlayerNPC(targetPlayer) && strcmp(targetName, "PizMan", true) == 0)" No.. to tam je ale uz od zacatku Link to comment Share on other sites More sharing options...
Dotaz
Benalek 0
Ahoj, chtěl bych se zeptat jak se dá zjistit zda hráč míří na NPC.
Já sem se to pokusil udělat takhle, ale ve výsledku se vubec nic nestalo:
Link to comment
Share on other sites
11 odpovědí na tuto otázku
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now