Jump to content
  • 0

Problema Comenzi


Roberteu11

Question

Salut tuturor. Ieri am incercat sa bag o conditie ca atunci cand playerul nu este langa masina sa nu o poata incuia. Am fost ajutat de cineva iar acum intampin alta problema. Majoritatea comenzilor de pe serverul meu nu mai merg. Adica atunci cand le folosesc nu apare nimic si nu se intampla nimic. Am cautat peste tot si nu am gasit o rezolvare.

La compilare primesc erorile astea:

E:\samp03csvr_win32\gamemodes\sagc.pwn(21479) : error 021: symbol already defined: "SendClientMessage"
E:\samp03csvr_win32\gamemodes\sagc.pwn(21480) : error 010: invalid function or declaration
Mi s-a spus sa caut ultima comanda de la OnPlayerCommandText. Am cautat-o si cred ca asta este. Comanda Fiind asta:
	if(strcmp(cmd, "/time", true) == 0)
		{
		    if(IsPlayerConnected(playerid))
			{
			    new mtext[20];
				new year, month,day;
				getdate(year, month, day);
				if(month == 1) { mtext = "January"; }
				else if(month == 2) { mtext = "February"; }
				else if(month == 3) { mtext = "March"; }
				else if(month == 4) { mtext = "April"; }
				else if(month == 5) { mtext = "May"; }
				else if(month == 6) { mtext = "June"; }
				else if(month == 7) { mtext = "July"; }
				else if(month == 8) { mtext = "August"; }
				else if(month == 9) { mtext = "September"; }
				else if(month == 10) { mtext = "October"; }
				else if(month == 11) { mtext = "November"; }
				else if(month == 12) { mtext = "December"; }
			    new hour,minuite,second;
				gettime(hour,minuite,second);
				FixHour(hour);
				hour = shifthour;

				format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d:%d~g~|", day, mtext, hour, minuite,second);
				GameTextForPlayer(playerid, string, 5000, 1);
			}
			return 1;
		}
		else
		{
            SendClientMessage(playerid, COLOR_WHITE, "[Info:] You are not logged in");
            return 1;
        }
	}
	SendClientMessage(playerid, COLOR_GREY, "[Error:] Invalid command, type /commands");
	return 1;
}

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

			}
			return 1;
		}
		else
		{
            SendClientMessage(playerid, COLOR_WHITE, "[Info:] You are not logged in");
            return 1;
        }
	}
[b]	SendClientMessage(playerid, COLOR_GREY, "[Error:] Invalid command, type /commands");
	[color=red]return 1[/color];[/b]
}

Si in loc de return 1; sa pun return 0; ?

Link to comment
Share on other sites

Acum am pus asa cum mi-ai spus tu!

	if(strcmp(cmd, "/time", true) == 0)
		{
		    if(IsPlayerConnected(playerid))
			{
			    new mtext[20];
				new year, month,day;
				getdate(year, month, day);
				if(month == 1) { mtext = "January"; }
				else if(month == 2) { mtext = "February"; }
				else if(month == 3) { mtext = "March"; }
				else if(month == 4) { mtext = "April"; }
				else if(month == 5) { mtext = "May"; }
				else if(month == 6) { mtext = "June"; }
				else if(month == 7) { mtext = "July"; }
				else if(month == 8) { mtext = "August"; }
				else if(month == 9) { mtext = "September"; }
				else if(month == 10) { mtext = "October"; }
				else if(month == 11) { mtext = "November"; }
				else if(month == 12) { mtext = "December"; }
			    new hour,minuite,second;
				gettime(hour,minuite,second);
				FixHour(hour);
				hour = shifthour;

				format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d:%d~g~|", day, mtext, hour, minuite,second);
				GameTextForPlayer(playerid, string, 5000, 1);
			}
			return 1;
		}
		else
		{
            SendClientMessage(playerid, COLOR_WHITE, "[Info:] You are not logged in");
            return 1;
        }
	}
	return 0;
}
Si am eroarea asta:
(21479) : error 010: invalid function or declaration
Randul 21479 este asta:
return 0;

Link to comment
Share on other sites

daca e GameMode pune return 0; daca e FilterScript pune return 1;...

tu ai facut o mare greseala la comanda ai pus return 0; la toate? nu?...

ee deaia sterge de la comenzi return 0; inlocuiesti cu return 1;....

iar la finalul lui

OnPlayerCommandText(playerid.cmd[])
{
if(strcmp(cmd, "/time", true) == 0)
		{
		    if(IsPlayerConnected(playerid))
			{
			    new mtext[20];
				new year, month,day;
				getdate(year, month, day);
				if(month == 1) { mtext = "January"; }
				else if(month == 2) { mtext = "February"; }
				else if(month == 3) { mtext = "March"; }
				else if(month == 4) { mtext = "April"; }
				else if(month == 5) { mtext = "May"; }
				else if(month == 6) { mtext = "June"; }
				else if(month == 7) { mtext = "July"; }
				else if(month == 8) { mtext = "August"; }
				else if(month == 9) { mtext = "September"; }
				else if(month == 10) { mtext = "October"; }
				else if(month == 11) { mtext = "November"; }
				else if(month == 12) { mtext = "December"; }
			    new hour,minuite,second;
				gettime(hour,minuite,second);
				FixHour(hour);
				hour = shifthour;

				format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d:%d~g~|", day, mtext, hour, minuite,second);
				GameTextForPlayer(playerid, string, 5000, 1);
			}
			return 1;
		}
		else
		{
            SendClientMessage(playerid, COLOR_WHITE, "[Info:] You are not logged in");
            return 1;
        }
	}
	return 0;
} 
return 0; //daca  e gm... iar 1 daca e fs
}

SendClientMessage este definit de doua ori cauta si sterge....

New GameMode In Development!-Romania Team Gang War-100%!...Datimi doua Motive afrimative de ce sa-l postez si-l postez...

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.