Jump to content
  • 0

Problema comanda undercover


Tudo

Question

Deci am incercat sa fac o comanda [/undercover] ca sa dispara Numere si bara de viata/armura de la player insa nu functioneaza si nu inteleg de ce, a fost un moment in care mi-a iesit a disparut dar cand dadeam [/undercover offf] nu mai aparea bara de viata/armura...am incercat toate metodele care le-am gasit pe wiki insa nu imi mai dau seama ce sa mai incerc...asa ca va rog pe voi sa-mi spuneti ce am gresit sau ce trebuie sa modific, si daca sunteti doritori as vrea sa-mi explicati putin ca sa stiu ce am gresit . :)

Va las aici toata comanda creata de mine, Multumesc .

	if(strcmp(cmd, "/undercover", true) == 0)
	{
		if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 2 ||PlayerInfo[playerid][pLeader] == 2)
		{
			if (PlayerToPoint(20, playerid,1211.0614,-4.8793,1000.9219) || PlayerToPoint(30, playerid,234.1019,159.8395,1003.0234))
			{
				new x_nr[256];
				x_nr = strtok(cmdtext, idx);
				if(!strlen(x_nr))
				{
					SendClientMessage(playerid, COLOR_WHITE, "{FF0000}Undercover: {FFFFFF}/undercover on/off");
					return 1;
				}
			 	if(strcmp(x_nr,"on",true) == 0)
				{
                   	for(new i = 0; i < MAX_PLAYERS; i++)
					{
					    ShowPlayerNameTagForPlayer(playerid, i, 0);
					}
				    if(Masked[playerid] == 1) return SCM(playerid, COLOR_FADE1, "Esti UnderCover!");
					GameTextForPlayer(playerid, "~W~Undercover ~R~ON", 5000, 5);
					Masked[playerid] = 1;
					BlockFind[playerid] = 1;
					ShowNameTags(0);
					SetPlayerSkin(playerid, skinsundercover[random(20)]);
				    return 1;
				}
				if(strcmp(x_nr,"off",true) == 0)
				{
                   	for(new i = 0; i < MAX_PLAYERS; i++)
					{
					    ShowPlayerNameTagForPlayer(playerid, i, 1);
					}
				    if(Masked[playerid] == 0) return SCM(playerid, COLOR_FADE1, "Nu esti UnderCover!");
					GameTextForPlayer(playerid, "~W~Undercover ~R~OFF", 5000, 5);
					Masked[playerid] = 0;
					ShowNameTags(1);
					BlockFind[playerid] = 0;
					SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
				    return 1;
				}
			}
		}
		return 1;
	}

 

Link to comment
Share on other sites

23 answers to this question

Recommended Posts

  • 0

foreach(Player,i)
                 {
                      ShowPlayerNameTagForPlayer(i, playerid, 0);
                   }

foreach(Player,i)
                 {
                      ShowPlayerNameTagForPlayer(i, playerid, 1);
                   }

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
11 hours ago, Geani said:

foreach(Player,i)
                 {
                      ShowPlayerNameTagForPlayer(i, playerid, 0);
                   }

foreach(Player,i)
                 {
                      ShowPlayerNameTagForPlayer(i, playerid, 1);
                   }

Problema este ca eu nu pot sa folosesc include-ul foreach deoarece primesc aceasta eroare la compilare...cum o pot rezolva ?!

E:\GM\GM\pawno\include\YSI\y_iterate.inc(909) : warning 202: number of arguments does not match definition
E:\GM\GM\pawno\include\YSI\y_iterate.inc(922) : error 025: function heading differs from prototype

 

Link to comment
Share on other sites

  • 0
On 04.03.2017 at 7:29 PM, Ksenon said:

Banuind ca ai versiunea 'noua' foreach(Player,i) devine foreach(new i : Player)

Am reusit insa acum  cand dau /undercover off nu mai apare bara... :| 

Link to comment
Share on other sites

  • 0
Acum 10 minute, Tudo a spus:

Am reusit insa acum  cand dau /undercover off nu mai apare bara... :| 

arata cum ai facut

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
1 hour ago, Geani said:

arata cum ai facut

Deci cand dau /undercover on dispare bara de viata,armura,nume iar cand dau /undercover off nu apare la normal ..

	if(strcmp(cmd, "/undercover", true) == 0) 
	{
		if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 2 ||PlayerInfo[playerid][pLeader] == 2)
		{
			if (PlayerToPoint(20, playerid,1211.0614,-4.8793,1000.9219) || PlayerToPoint(30, playerid,234.1019,159.8395,1003.0234))
			{
				new x_nr[256];
				x_nr = strtok(cmdtext, idx);
				if(!strlen(x_nr))
				{
					SendClientMessage(playerid, COLOR_WHITE, "{FF0000}Undercover: {FFFFFF}/undercover on/off");
					return 1;
				}
			 	if(strcmp(x_nr,"on",true) == 0)
				{
					foreach(new i : Player)
					{
                      ShowPlayerNameTagForPlayer(i, playerid, 0);
                   	}
				    if(Masked[playerid] == 1) return SCM(playerid, COLOR_FADE1, "Esti UnderCover!");
					GameTextForPlayer(playerid, "~W~Undercover ~R~ON", 5000, 5);
					Masked[playerid] = 1;
					BlockFind[playerid] = 1;
					ShowNameTags(0);
					SetPlayerSkin(playerid, skinsundercover[random(20)]);
				    return 1;
				}
				if(strcmp(x_nr,"off",true) == 0)
				{
					foreach(new i : Player)
					{
                      ShowPlayerNameTagForPlayer(i, playerid, 1);
                   	}
				    if(Masked[playerid] == 0) return SCM(playerid, COLOR_FADE1, "Nu esti UnderCover!");
					GameTextForPlayer(playerid, "~W~Undercover ~R~OFF", 5000, 5);
					Masked[playerid] = 0;
					ShowNameTags(1);
					BlockFind[playerid] = 0;
					SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
				    return 1;
				}
			}
		}
		return 1;
	}

P.S Mersi de ajutor .

Link to comment
Share on other sites

  • 0
Acum 3 minute, Tudo a spus:

Deci cand dau /undercover on dispare bara de viata,armura,nume iar cand dau /undercover off nu apare la normal ..


	if(strcmp(cmd, "/undercover", true) == 0) 
	{
		if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 2 ||PlayerInfo[playerid][pLeader] == 2)
		{
			if (PlayerToPoint(20, playerid,1211.0614,-4.8793,1000.9219) || PlayerToPoint(30, playerid,234.1019,159.8395,1003.0234))
			{
				new x_nr[256];
				x_nr = strtok(cmdtext, idx);
				if(!strlen(x_nr))
				{
					SendClientMessage(playerid, COLOR_WHITE, "{FF0000}Undercover: {FFFFFF}/undercover on/off");
					return 1;
				}
			 	if(strcmp(x_nr,"on",true) == 0)
				{
					foreach(new i : Player)
					{
                      ShowPlayerNameTagForPlayer(i, playerid, 0);
                   	}
				    if(Masked[playerid] == 1) return SCM(playerid, COLOR_FADE1, "Esti UnderCover!");
					GameTextForPlayer(playerid, "~W~Undercover ~R~ON", 5000, 5);
					Masked[playerid] = 1;
					BlockFind[playerid] = 1;
					ShowNameTags(0);
					SetPlayerSkin(playerid, skinsundercover[random(20)]);
				    return 1;
				}
				if(strcmp(x_nr,"off",true) == 0)
				{
					foreach(new i : Player)
					{
                      ShowPlayerNameTagForPlayer(i, playerid, 1);
                   	}
				    if(Masked[playerid] == 0) return SCM(playerid, COLOR_FADE1, "Nu esti UnderCover!");
					GameTextForPlayer(playerid, "~W~Undercover ~R~OFF", 5000, 5);
					Masked[playerid] = 0;
					ShowNameTags(1);
					BlockFind[playerid] = 0;
					SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
				    return 1;
				}
			}
		}
		return 1;
	}

P.S Mersi de ajutor .

	if(strcmp(cmd, "/undercover", true) == 0) 
	{
		if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 2 ||PlayerInfo[playerid][pLeader] == 2)
		{
			if (PlayerToPoint(20, playerid,1211.0614,-4.8793,1000.9219) || PlayerToPoint(30, playerid,234.1019,159.8395,1003.0234))
			{
				new x_nr[256];
				x_nr = strtok(cmdtext, idx);
				if(!strlen(x_nr))
				{
					SendClientMessage(playerid, COLOR_WHITE, "{FF0000}Undercover: {FFFFFF}/undercover on/off");
					return 1;
				}
			 	if(strcmp(x_nr,"on",true) == 0)
				{
					foreach(new i : Player)
					{
                      ShowPlayerNameTagForPlayer(i, playerid, 1);
                   	}
				    if(Masked[playerid] == 1) return SCM(playerid, COLOR_FADE1, "Esti UnderCover!");
					GameTextForPlayer(playerid, "~W~Undercover ~R~ON", 5000, 5);
					Masked[playerid] = 1;
					BlockFind[playerid] = 1;
					ShowNameTags(0);
					SetPlayerSkin(playerid, skinsundercover[random(20)]);
				    return 1;
				}
				if(strcmp(x_nr,"off",true) == 0)
				{
					foreach(new i : Player)
					{
                      ShowPlayerNameTagForPlayer(i, playerid, 0);
                   	}
				    if(Masked[playerid] == 0) return SCM(playerid, COLOR_FADE1, "Nu esti UnderCover!");
					GameTextForPlayer(playerid, "~W~Undercover ~R~OFF", 5000, 5);
					Masked[playerid] = 0;
					ShowNameTags(1);
					BlockFind[playerid] = 0;
					SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
				    return 1;
				}
			}
		}
		return 1;
	}
incearca asa

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0

 

 

 

 

 

11 minutes ago, Geani said:

	if(strcmp(cmd, "/undercover", true) == 0) 
	{
		if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pMember] == 2 ||PlayerInfo[playerid][pLeader] == 2)
		{
			if (PlayerToPoint(20, playerid,1211.0614,-4.8793,1000.9219) || PlayerToPoint(30, playerid,234.1019,159.8395,1003.0234))
			{
				new x_nr[256];
				x_nr = strtok(cmdtext, idx);
				if(!strlen(x_nr))
				{
					SendClientMessage(playerid, COLOR_WHITE, "{FF0000}Undercover: {FFFFFF}/undercover on/off");
					return 1;
				}
			 	if(strcmp(x_nr,"on",true) == 0)
				{
					foreach(new i : Player)
					{
                      ShowPlayerNameTagForPlayer(i, playerid, 1);
                   	}
				    if(Masked[playerid] == 1) return SCM(playerid, COLOR_FADE1, "Esti UnderCover!");
					GameTextForPlayer(playerid, "~W~Undercover ~R~ON", 5000, 5);
					Masked[playerid] = 1;
					BlockFind[playerid] = 1;
					ShowNameTags(0);
					SetPlayerSkin(playerid, skinsundercover[random(20)]);
				    return 1;
				}
				if(strcmp(x_nr,"off",true) == 0)
				{
					foreach(new i : Player)
					{
                      ShowPlayerNameTagForPlayer(i, playerid, 0);
                   	}
				    if(Masked[playerid] == 0) return SCM(playerid, COLOR_FADE1, "Nu esti UnderCover!");
					GameTextForPlayer(playerid, "~W~Undercover ~R~OFF", 5000, 5);
					Masked[playerid] = 0;
					ShowNameTags(1);
					BlockFind[playerid] = 0;
					SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
				    return 1;
				}
			}
		}
		return 1;
	}
incearca asa

 

Am incercat si asa..tot degeaba .

Dar treaba este ca daca nu pun "ShowNameTags(0);" nu dispare bara ...

Edited by Tudo
Link to comment
Share on other sites

  • 0
12 hours ago, Tudo said:

 

 

 

 

 

Am incercat si asa..tot degeaba .

Dar treaba este ca daca nu pun "ShowNameTags(0);" nu dispare bara ...

Problema ta este ca nu dispare numele, pentru ca nu stii sa folosesti functia, te uiti la urmatoarele doua comenzi si intelegi cum functioneaza

if (strcmp("/nameoff", cmdtext, true) == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
		ShowPlayerNameTagForPlayer(i, playerid, false);
		
	NameTag[playerid] = 0;
    GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
    return 1;
}
if (strcmp("/nameon", cmdtext, true) == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
		ShowPlayerNameTagForPlayer(i, playerid, true);
		
	NameTag[playerid] = 1;
    GameTextForPlayer(playerid, "~W~Nametags ~G~ON", 5000, 5);
    return 1;
}

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
5 hours ago, Mister said:

Problema ta este ca nu dispare numele, pentru ca nu stii sa folosesti functia, te uiti la urmatoarele doua comenzi si intelegi cum functioneaza


if (strcmp("/nameoff", cmdtext, true) == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
		ShowPlayerNameTagForPlayer(i, playerid, false);
		
	NameTag[playerid] = 0;
    GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
    return 1;
}
if (strcmp("/nameon", cmdtext, true) == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
		ShowPlayerNameTagForPlayer(i, playerid, true);
		
	NameTag[playerid] = 1;
    GameTextForPlayer(playerid, "~W~Nametags ~G~ON", 5000, 5);
    return 1;
}

Acum e problema asta , iar ShowNameTags(0); nu-l mai folosesc ca din cat am facut eu asta imi facea bara sa dispara..

error 017: undefined symbol "NameTag"

 

Link to comment
Share on other sites

  • 0
Acum 53 minute, Tudo a spus:

Acum e problema asta , iar ShowNameTags(0); nu-l mai folosesc ca din cat am facut eu asta imi facea bara sa dispara..


error 017: undefined symbol "NameTag"

 

Unde ai definite celelate variabile globale scria asta new NameTag [MAX_PLAYERS]

Link to comment
Share on other sites

  • 0
Just now, AddisoN said:

Da undercover off si vezi daca mai apar. (Daca nu mai apar iti zic unde e problema)

Deci am facut pe comanda asta am definit dupa cum mi-ai spus "new NameTag[MAX_PLAYERS];" , si am incercat in joc, la ambele comenzi nu se intampla nimic .

if (strcmp("/nameoff", cmdtext, true) == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
		ShowPlayerNameTagForPlayer(i, playerid, false);
		
	NameTag[playerid] = 0;
    GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
    return 1;
}
if (strcmp("/nameon", cmdtext, true) == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
		ShowPlayerNameTagForPlayer(i, playerid, true);
		
	NameTag[playerid] = 1;
    GameTextForPlayer(playerid, "~W~Nametags ~G~ON", 5000, 5);
    return 1;
}

 

Link to comment
Share on other sites

  • 0
Acum 44 minute, Tudo a spus:

Deci am facut pe comanda asta am definit dupa cum mi-ai spus "new NameTag[MAX_PLAYERS];" , si am incercat in joc, la ambele comenzi nu se intampla nimic .


if (strcmp("/nameoff", cmdtext, true) == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
		ShowPlayerNameTagForPlayer(i, playerid, false);
		
	NameTag[playerid] = 0;
    GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
    return 1;
}
if (strcmp("/nameon", cmdtext, true) == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
		ShowPlayerNameTagForPlayer(i, playerid, true);
		
	NameTag[playerid] = 1;
    GameTextForPlayer(playerid, "~W~Nametags ~G~ON", 5000, 5);
    return 1;
}

 

if (strcmp("/nameoff", cmdtext, true) == 0)
{
    for(new i = GetPlayerPoolSize(); i != -1; --i) ShowPlayerNameTagForPlayer(playerid, i, false);
    GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
    return 1;
}

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
30 minutes ago, Geani said:

if (strcmp("/nameoff", cmdtext, true) == 0)
{
    for(new i = GetPlayerPoolSize(); i != -1; --i) ShowPlayerNameTagForPlayer(playerid, i, false);
    GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
    return 1;
}

Am incercat si asta, m-am uitat pe wiki la toate dar tot nu functioneaza, singura chestie care imi face bara sa dispara este " ShowNameTags(0); " insa de aparut inapoi teoretic este  ShowNameTags(1); dar nu apare bara .

Link to comment
Share on other sites

  • 0
Acum 6 minute, Tudo a spus:

Am incercat si asta, m-am uitat pe wiki la toate dar tot nu functioneaza, singura chestie care imi face bara sa dispara este " ShowNameTags(0); " insa de aparut inapoi teoretic este  ShowNameTags(1); dar nu apare bara .

depinde ce gm folosesti 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
Acum 11 ore, Tudo a spus:

Am incercat si asta, m-am uitat pe wiki la toate dar tot nu functioneaza, singura chestie care imi face bara sa dispara este " ShowNameTags(0); " insa de aparut inapoi teoretic este  ShowNameTags(1); dar nu apare bara .

Daca folosesti ShowNameTags nu modifici doar pt un player ci pt tot serverul

Link to comment
Share on other sites

  • 0
13 hours ago, Tudo said:

Folosesc un gamemode mai vechi deoarece mi se pare mult mai usor sa invat pe el .

Esti sigur ca nu ai s*beitul activat ? :)

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
6 hours ago, AddisoN said:

Daca folosesti ShowNameTags nu modifici doar pt un player ci pt tot serverul

Am inteles, asta chiar nu am stiut, dar cand foloseam disparea doar la jucatorul care folosea comanda la ceilalti ramanea .

3 hours ago, Mister said:

Esti sigur ca nu ai s*beitul activat ? :)

Nu, nu am nici macar sobeit in pc . ;)

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.