Jump to content

Question

Posted

Nick:WiLi

Problema: Cand dau /wanted nu-mi apar jucatorii care au wanted pe server

Erori / warnings:-

Lini/script:

if(strcmp(cmd, "/wanted", true) == 0)

{

    if(IsPlayerConnected(playerid))

  {

if(gTeam[playerid] == 2 || IsACop(playerid) || (PlayerInfo[playerid][pAdmin] >= 7))

{

new x;

SendClientMessage(playerid, COLOR_2RED, "{F3FF02}|____ Suspectii SERVER ____|");

    for(new i=0; i < MAX_PLAYERS; i++) {

if(IsPlayerConnected(i))

{

    if(WantedLevel > 0)

    {

GetPlayerName(i, giveplayer, sizeof(giveplayer));

format(string, sizeof(string), "{F3FF02}%s%s are Wanted %d", string,giveplayer,WantedLevel);

x++;

if(x > 3) {

    SendClientMessage(playerid, COLOR_YELLOW, string);

    x = 0;

format(string, sizeof(string), "");

} else {

format(string, sizeof(string), "%s, ", string);

}

}

}

}

if(x <= 3 && x > 0) {

string[strlen(string)-2] = '.';

    SendClientMessage(playerid, COLOR_YELLOW, string);

}

}

else

{

    SendClientMessage(playerid, COLOR_2RED, "  Nu esti in PD/NG/FBI !");

}

}//not connected

return 1;

}

Ai incercat sa rezolvi singur ?:Da, am reusit sa rezolv o parte,adica aparea /wanted-ul doar la cei care luau wanted cu comanda /su ... Mai sus este o versiune mai veche

3 answers to this question

Recommended Posts

Posted

Poftim o comanda :

	if(strcmp(cmd, "/wanted", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	   	{
			if(IsACop(playerid))
			{
				new x;
				SendClientMessage(playerid, COLOR_GREEN, "____Lista infractori:____");
			    for(new i=0; i < MAX_PLAYERS; i++) {
					if(IsPlayerConnected(i))
					{
					    if(WantedLevel[i] > 0)
					    {
							GetPlayerName(i, giveplayer, sizeof(giveplayer));
							format(string, sizeof(string), "%s: %d puncte wanted | Infractiune: %s",giveplayer,WantedLevel[i]);
							x++;
							if(x > 3) {
							    SendClientMessage(playerid, COLOR_YELLOW, string);
							    x = 0;
								format(string, sizeof(string), "");
							} else {
								format(string, sizeof(string), "%s, ", string);
							}
						}
					}
				}
				if(x <= 3 && x > 0) {
					string[strlen(string)-2] = '.';
				    SendClientMessage(playerid, COLOR_YELLOW, string);
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "* Nu esti politist!");
			}
	                   
		}//not connected
		return 1;
	}

Posted

Comanda /wanted:

[pawn]if(strcmp(cmd, "/wanted", true) == 0)

{

    if(IsPlayerConnected(playerid))

  {

if(gTeam[playerid] == 2 || IsACop(playerid))

{

new x;

SendClientMessage(playerid, COLOR_GREEN, "Current Wanted Suspects:");

    for(new i=0; i < MAX_PLAYERS; i++) {

if(IsPlayerConnected(i))

{

    if(WantedLevel > 1)

    {

GetPlayerName(i, giveplayer, sizeof(giveplayer));

format(string, sizeof(string), "%s%s: %d", string,giveplayer,WantedLevel);

x++;

if(x > 3) {

    SendClientMessage(playerid, COLOR_YELLOW, string);

    x = 0;

format(string, sizeof(string), "");

} else {

format(string, sizeof(string), "%s, ", string);

}

}

}

}

if(x <= 3 && x > 0) {

string[strlen(string)-2] = '.';

    SendClientMessage(playerid, COLOR_YELLOW, string);

}

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "  You're not a Cop / FBI / National Guard !");

}

}//not connected

return 1;

}[/pawn]

Posted

Topic inchis , 48h fara reply.

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

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.