SA-MP Forums Archive
Help please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help please (/showthread.php?tid=570131)



Help please - KiM0Ro - 05.04.2015

Hi i have a problem i want to create a command to stop the turf but it sayn me that..
Код:
warning 202: number of arguments does not match definition
Код:
CMD:stoptz(playerid,params[])
{
	new string[128];
	if(PlayerInfo[playerid][Admin]>=4)
	{
	    TurfWars();
     	KillTimer(timerTz);
     	format(string,128,"{CFF55F}[Admin]:{FFFFFF}%s a oprit batalia.",GetName(playerid));
     	SendClientMessageToAll(-1,string);
	}
	return 1;
}
And if i want to remove that TurfWars() the command it's not working,any ideas?


Re: Help please - nezo2001 - 05.04.2015

I think it is here
PHP код:
format(string,128,"{CFF55F}[Admin]:{FFFFFF}%s a oprit batalia.",GetName(playerid)); 
it should replace with
PHP код:
format(string,sizeof(string),"{CFF55F}[Admin]:{FFFFFF}%s a oprit batalia.",GetName(playerid)); 



Re: Help please - KiM0Ro - 05.04.2015

Still i have the warning,the problem don't was at the string,any ideas? Ahh and yes,the string it's defined at 128.. string[128];(into the gm,new string[128]


Re: Help please - ATGOggy - 05.04.2015

Show the code of the custom function TurfWars()

Also tell the line of the error.
Nezoo, typing there 128 or sizeof(string) is same because the size of that string is 128.


Re: Help please - Jimmy0wns - 05.04.2015

I think the issue lays with
Код:
TurfWars();



Re: Help please - KiM0Ro - 05.04.2015

Код:
function TurfWars(team1, team2, turfid)
{
	new string[64];
	if(team1 == 7) GroveTimer2 = 7200;
	else if(team1 == 10) BallasTimer2 = 7200;
	else if(team1 == 9) VagosTimer2 = 7200;
	else if(team1 == 8) AztecasTimer2 = 7200;
	if(team1 == 7 && team2 == 10)
	{
	    if(Score[2] == 0 && Score[3] == 0)
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {660066}Ballas{FFFFFF} haven't defended their Gang Zone and lost it!");
	        TurfTakeOver(turfid, team1);
	    }
	    else if(Score[2] == Score[3])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* The fight between {006400}Grove Street{FFFFFF} and {660066}Ballas{FFFFFF} has ended as a Draw!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[2], Score[3]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
	    }
	    else if(Score[2] > Score[3])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {006400}Grove Street{FFFFFF} pwned {660066}Ballas{FFFFFF} and took over their Gang Zone!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[2], Score[3]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        TurfTakeOver(turfid, team1);
	        gstpts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `gstpts` = '%d' WHERE `id` = '1'",gstpts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    else if(Score[2] < Score[3])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {006400}Grove Street{FFFFFF} lost in front of {660066}Ballas{FFFFFF}'s mighty Defence!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[2], Score[3]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
			ballaspts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `ballaspts` = '%d' WHERE `id` = '1'",ballaspts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    GroveBallas2 = 0;
	    Score[2] = 0;
	    Score[3] = 0;
	}
	else if(team1 == 7 && team2 == 9)
	{
	    if(Score[2] == 0 && Score[4] == 0)
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {F8CB45}Los Santos Vagos{FFFFFF} haven't defended their Gang Zone and lost it!");
	        TurfTakeOver(turfid, team1);
	    }
	    else if(Score[2] == Score[4])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* The fight between {006400}Grove Street{FFFFFF} and {F8CB45}Los Santos Vagos{FFFFFF} has ended as a Draw!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[2], Score[4]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
	    }
	    else if(Score[2] > Score[4])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {006400}Grove Street{FFFFFF} pwned {F8CB45}Los Santos Vagos{FFFFFF} and took over their Gang Zone!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[2], Score[4]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        TurfTakeOver(turfid, team1);
	        gstpts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `gstpts` = '%d' WHERE `id` = '1'",gstpts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    else if(Score[2] < Score[4])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {006400}Grove Street{FFFFFF} lost in front of {F8CB45}Los Santos Vagos{FFFFFF}'s mighty Defence!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[2], Score[4]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
			lsvpts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `lsvpts` = '%d' WHERE `id` = '1'",lsvpts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    GroveVagos2 = 0;
	    Score[2] = 0;
	    Score[4] = 0;
	}
	else if(team1 == 10 && team2 == 7)
	{
	    if(Score[3] == 0 && Score[2] == 0)
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {006400}Grove Street{FFFFFF} haven't defended their Gang Zone and lost it!");
	        TurfTakeOver(turfid, team1);
	    }
	    else if(Score[3] == Score[2])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* The fight between {660066}Ballas{FFFFFF} and {006400}Grove Street{FFFFFF} has ended as a Draw!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[3], Score[2]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
	    }
	    else if(Score[3] > Score[2])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {660066}Ballas{FFFFFF} pwned {006400}Grove Street{FFFFFF} and took over their Gang Zone!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[3], Score[2]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        TurfTakeOver(turfid, team1);
	        ballaspts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `ballaspts` = '%d' WHERE `id` = '1'",ballaspts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    else if(Score[3] < Score[2])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {660066}Ballas{FFFFFF} lost in front of {006400}Grove Street{FFFFFF}'s mighty Defence!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[3], Score[2]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
			gstpts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `gstpts` = '%d' WHERE `id` = '1'",gstpts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    GroveBallas2 = 0;
	    Score[2] = 0;
	    Score[3] = 0;
	}
	else if(team1 == 10 && team2 == 8)
	{
	    if(Score[3] == 0 && Score[5] == 0)
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {00F5FF}Varrios Los Aztecas{FFFFFF} haven't defended their Gang Zone and lost it!");
	        TurfTakeOver(turfid, team1);
	    }
	    else if(Score[3] == Score[5])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* The fight between {660066}Ballas{FFFFFF} and {00F5FF}Varrios Los Aztecas{FFFFFF} has ended as a Draw!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[3], Score[5]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
	    }
	    else if(Score[3] > Score[5])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {660066}Ballas{FFFFFF} pwned {00F5FF}Varrios Los Aztecas{FFFFFF} and took over their Gang Zone!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[3], Score[5]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        TurfTakeOver(turfid, team1);
	        ballaspts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `ballaspts` = '%d' WHERE `id` = '1'",ballaspts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    else if(Score[3] < Score[5])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {660066}Ballas{FFFFFF} lost in front of {00F5FF}Varrios Los Aztecas{FFFFFF}'s mighty Defence!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[3], Score[5]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
			vlapts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `vlapts` = '%d' WHERE `id` = '1'",vlapts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    AztecasBallas2 = 0;
	    Score[3] = 0;
	    Score[5] = 0;
	}
	else if(team1 == 9 && team2 == 7)
	{
	    if(Score[4] == 0 && Score[2] == 0)
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {006400}Grove Street{FFFFFF} haven't defended their Gang Zone and lost it!");
	        TurfTakeOver(turfid, team1);
	    }
	    else if(Score[4] == Score[2])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* The fight between {F8CB45}Los Santos Vagos{FFFFFF} and {006400}Grove Street{FFFFFF} has ended as a Draw!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[4], Score[2]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
	    }
	    else if(Score[4] > Score[2])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {F8CB45}Los Santos Vagos{FFFFFF} pwned {006400}Grove Street{FFFFFF} and took over their Gang Zone!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[4], Score[2]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        TurfTakeOver(turfid, team1);
	        lsvpts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `lsvpts` = '%d' WHERE `id` = '1'",lsvpts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    else if(Score[4] < Score[2])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {F8CB45}Los Santos Vagos{FFFFFF} lost in front of {006400}Grove Street{FFFFFF}'s mighty Defence!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[4], Score[2]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
			gstpts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `gstpts` = '%d' WHERE `id` = '1'",gstpts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    GroveVagos = 0;
	    Score[2] = 0;
	    Score[4] = 0;
	}
	else if(team1 == 9 && team2 == 8)
	{
	    if(Score[4] == 0 && Score[5] == 0)
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {00F5FF}Varrios Los Aztecas{FFFFFF} haven't defended their Gang Zone and lost it!");
	        TurfTakeOver(turfid, team1);
	    }
	    else if(Score[4] == Score[5])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* The fight between {F8CB45}Los Santos Vagos{FFFFFF} and {00F5FF}Varrios Los Aztecas{FFFFFF} has ended as a Draw!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[4], Score[5]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
	    }
	    else if(Score[4] > Score[5])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {F8CB45}Los Santos Vagos{FFFFFF} pwned {00F5FF}Varrios Los Aztecas{FFFFFF} and took over their Gang Zone!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[4], Score[5]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        TurfTakeOver(turfid, team1);
	        lsvpts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `lsvpts` = '%d' WHERE `id` = '1'",lsvpts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    else if(Score[4] < Score[5])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {F8CB45}Los Santos Vagos{FFFFFF} lost in front of {00F5FF}Varrios Los Aztecas{FFFFFF}'s mighty Defence!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[4], Score[5]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
			vlapts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `vlapts` = '%d' WHERE `id` = '1'",vlapts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    AztecasVagos2 = 0;
	    Score[4] = 0;
	    Score[5] = 0;
	}
	else if(team1 == 8 && team2 == 10)
	{
	    if(Score[5] == 0 && Score[3] == 0)
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {660066}Ballas{FFFFFF} haven't defended their Gang Zone and lost it!");
	        TurfTakeOver(turfid, team1);
	    }
	    else if(Score[5] == Score[3])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* The fight between {00F5FF}Varrios Los Aztecas{FFFFFF} and {660066}Ballas{FFFFFF} has ended as a Draw!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[5], Score[3]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
	    }
	    else if(Score[5] > Score[3])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {00F5FF}Varrios Los Aztecas{FFFFFF} pwned {660066}Ballas{FFFFFF} and took over their Gang Zone!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[5], Score[3]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        TurfTakeOver(turfid, team1);
	        vlapts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `vlapts` = '%d' WHERE `id` = '1'",vlapts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    else if(Score[5] < Score[3])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {00F5FF}Varrios Los Aztecas{FFFFFF} lost in front of {660066}Ballas{FFFFFF}'s mighty Defence!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[5], Score[3]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
			ballaspts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `ballaspts` = '%d' WHERE `id` = '1'",ballaspts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    AztecasBallas2 = 0;
	    Score[3] = 0;
	    Score[5] = 0;
	}
	else if(team1 == 8 && team2 == 9)
	{
	    if(Score[5] == 0 && Score[4] == 0)
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {F8CB45}Los Santos Vagos{FFFFFF} haven't defended their Gang Zone and lost it!");
	        TurfTakeOver(turfid, team1);
	    }
	    else if(Score[5] == Score[4])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* The fight between {00F5FF}Varrios Los Aztecas{FFFFFF} and {F8CB45}Los Santos Vagos{FFFFFF} has ended as a Draw!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[5], Score[4]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
	    }
	    else if(Score[5] > Score[4])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {00F5FF}Varrios Los Aztecas{FFFFFF} pwned {F8CB45}Los Santos Vagos{FFFFFF} and took over their Gang Zone!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[5], Score[4]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        TurfTakeOver(turfid, team1);
	        vlapts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `vlapts` = '%d' WHERE `id` = '1'",vlapts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    else if(Score[5] < Score[4])
	    {
	        SendClientMessageToAll(COLOR_WHITE, "* {00F5FF}Varrios Los Aztecas{FFFFFF} lost in front of {F8CB45}Los Santos Vagos{FFFFFF}'s mighty Defence!");
	        format(string, sizeof(string), "* Final Score: %d - %d", Score[5], Score[4]);
	        SendClientMessageToAll(COLOR_WHITE, string);
	        GangZoneStopFlashForAll(GzS[turfid]);
			TurfWar[turfid] = 0;
			lsvpts++;
	        gQuery[0] = (EOS);
			format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `lsvpts` = '%d' WHERE `id` = '1'",lsvpts);
			mysql_tquery(handle, gQuery, "", "");
	    }
	    AztecasVagos2 = 0;
	    Score[4] = 0;
	    Score[5] = 0;
	}
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(WasInZone[i] == turfid)
		{
			WasInZone[i] = -1;
			if(IsPlayerConnected(i))
				TextDrawHideForPlayer(i, DamageTxT);
		}
	}
	ZoneAttacker[turfid] = 0;
	KillStreakReset();
	SaveGzT();
	return 1;
}



Re: Help please - ATGOggy - 05.04.2015

You don't need to create one because you already have one or the compiler will not show that error.


Re: Help please - KiM0Ro - 05.04.2015

I put the codes,look backward


Re: Help please - ATGOggy - 05.04.2015

Tell the line of error


Re: Help please - KiM0Ro - 05.04.2015

It's not a error it's a warning ..
Код:
warning 202: number of arguments does not match definition