Jump to content
  • 0

Problema /gov


Nametodie

Question

Problemă întâlnită (descriere): Cand folosesc /gov, spune ca nu fac parte din factiunea pd, ng sau fbi.
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul:

[pawn] if(strcmp(cmd, "/government", true) == 0 || strcmp(cmd, "/gov", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] != 2)
{
SendClientMessage(playerid, COLOR_GREY, "{30a030}[server]: {ffffff}Ne pare rau, dar nu faci parte din factiunea {000cff}LSPD{ffffff}, {000cff}NG {ffffff}sau {000cff}FBI{ffffff}.");
return 1;
}
if(PlayerInfo[playerid][pRank] < 5)
{
SendClientMessage(playerid, COLOR_GREY, "{30a030}[server]: {ffffff}Ne pare rau, dar ai nevie de Rank 5 pentru a utiliza aceasta comanda.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "» Scrie: (/gov)ernment [text]");
return 1;
}
format(string, sizeof(string), "{000cff}Cop %s: {ffffff}%s", sendername, result);
SendClientMessageToAll(COLOR_DBLUE, string);
}
return 1;
}[/pawn]
Imagini / Video (optional):-
Aţi încercat să rezolvaţi singur?: Da

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Ok,incearca asta:

[pawn]if(strcmp(cmd, "/government", true) == 0 || strcmp(cmd, "/gov", true) == 0)

{

if(IsPlayerConnected(playerid))

{

if(IsACop(playerid))
{

SendClientMessage(playerid, COLOR_GREY, "{30a030}[server]: {ffffff}Ne pare rau, dar nu faci parte din factiunea {000cff}LSPD{ffffff}, {000cff}NG {ffffff}sau {000cff}FBI{ffffff}.");

return 1;

}

if(PlayerInfo[playerid][pRank] < 5)

{

SendClientMessage(playerid, COLOR_GREY, "{30a030}[server]: {ffffff}Ne pare rau, dar ai nevie de Rank 5 pentru a utiliza aceasta comanda.");

return 1;

}

GetPlayerName(playerid, sendername, sizeof(sendername));

new length = strlen(cmdtext);

while ((idx < length) && (cmdtext[idx] <= ' '))

{

idx++;

}

new offset = idx;

new result[64];

while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))

{

result[idx - offset] = cmdtext[idx];

idx++;

}

result[idx - offset] = EOS;

if(!strlen(result))

{

SendClientMessage(playerid, COLOR_GRAD2, "» Scrie: (/gov)ernment [text]");

return 1;

}

format(string, sizeof(string), "{000cff}Cop %s: {ffffff}%s", sendername, result);

SendClientMessageToAll(COLOR_DBLUE, string);

}

return 1;

}[/pawn]

 

 

Link to comment
Share on other sites

Ok,incearca asta:

[pawn]if(strcmp(cmd, "/government", true) == 0 || strcmp(cmd, "/gov", true) == 0)

{

if(IsPlayerConnected(playerid))

{

if(IsACop(playerid))

{

SendClientMessage(playerid, COLOR_GREY, "{30a030}[server]: {ffffff}Ne pare rau, dar nu faci parte din factiunea {000cff}LSPD{ffffff}, {000cff}NG {ffffff}sau {000cff}FBI{ffffff}.");

return 1;

}

if(PlayerInfo[playerid][pRank] < 5)

{

SendClientMessage(playerid, COLOR_GREY, "{30a030}[server]: {ffffff}Ne pare rau, dar ai nevie de Rank 5 pentru a utiliza aceasta comanda.");

return 1;

}

GetPlayerName(playerid, sendername, sizeof(sendername));

new length = strlen(cmdtext);

while ((idx < length) && (cmdtext[idx] <= ' '))

{

idx++;

}

new offset = idx;

new result[64];

while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))

{

result[idx - offset] = cmdtext[idx];

idx++;

}

result[idx - offset] = EOS;

if(!strlen(result))

{

SendClientMessage(playerid, COLOR_GRAD2, "» Scrie: (/gov)ernment [text]");

return 1;

}

format(string, sizeof(string), "{000cff}Cop %s: {ffffff}%s", sendername, result);

SendClientMessageToAll(COLOR_DBLUE, string);

}

return 1;

}[/pawn]

Am reusit pana la urma dar am alta problema cu o alta comanda.

if(strcmp(cmd, "/unprison",true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pAdmin] < 2)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "{30a030}TEXT.");
	            return 1;
	        }
	        tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "» /unprison [playerid/PartOfName]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
		    if(IsPlayerConnected(giveplayerid))
		    {
		        if(giveplayerid != INVALID_PLAYER_ID)
		        {
		            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "TEXT", giveplayer);
					SendClientMessage(playerid, COLOR_LIGHTRED, string);
					format(string, sizeof(string), "TEXT", sendername);
					SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
					GameTextForPlayer(giveplayerid, "~w~TEXT", 5000, 3);
					PlayerInfo[giveplayerid][pJailed] = 0;
					PlayerInfo[giveplayerid][pJailTime] = 0;
		            SetPlayerPos(playerid, 90.2101,1920.4854,17.9422);
					SetPlayerWorldBounds(playerid,20000.0000,-20000.0000,20000.0000,-20000.0000); //Reset world to player
		        }
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "{30a030}TEXT.");
			    return 1;
			}
	    }
	    return 1;
	}

Cand dau cuiva /unprison, asa arata: http://postimg.org/image/73jqglspv/

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.