[Duv] Como completar este comando?
#1

eu uso o godfather e criei um comando de criar uma barreira na estrada mas so conseguir que a Organizaзгo de id 1 (policia) executasse o comando. Mas eu queria que as organizaзхes 2 (FBI) e 3 (EXERCITO) tambem pudessem usar este comando vejam:
Quote:

//--------------------------------=[Roadblock]=-----------------------------------
if(strcmp(cmdtext, "/barreira", true)==0 || strcmp(cmdtext, "/br", true)==0)
{
if (PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pLeader] != 1) return SendClientMessage(playerid, COLOR_GREY, "You are not a cop!");
if (PlayerInfo[playerid][pRoadblock] != 0) return SendClientMessage(playerid, COLOR_GREY, "You can only deploy 1 roadblock at a time, type /rrb to remove your existing one.");
if (roadblocktimer != 0) return SendClientMessage(playerid, COLOR_GREY, "Please wait before trying to spawn another roadblock!");
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
PlayerInfo[playerid][pRoadblock] = CreateObject(981, X, Y, Z, 0.0, 0.0, A+180);
SetPlayerPos(playerid, X, Y, Z+4);
GameTextForPlayer(playerid, "~w~Roadblock ~r~Placed", 5000, 5);
SendClientMessage(playerid, COLOR_GREEN, "Roadblock deployed successfully, type /rbr or /removerbarreira to remove it.");
roadblocktimer = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "HQ: A roadblock has been deployed by %s, it has been marked on the map by a checkpoint.", sendername);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1)
{
SetPlayerCheckpoint(playerid, X, Y, Z-10, 1.0);
SendClientMessage(i, TEAM_BLUE_COLOR, string);
if (PlayerInfo[i][pRank] >= 5 && PlayerInfo[i][pMember] || PlayerInfo[i][pLeader] == 1)
{
SendClientMessage(i, COLOR_YELLOW, "You can remove all roadblocks by typing /rrball");
}
}
}
}
SetTimer("ResetRoadblockTimer", 60000, false);
return 1;
}
//----------
if(strcmp(cmdtext, "/removerbarreira", true)==0 || strcmp(cmdtext, "/rbr", true)==0)
{
if (PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pLeader] != 1)
{
SendClientMessage(playerid, COLOR_GREY, "You are not a cop!");
return 1;
}
if (PlayerInfo[playerid][pRank] < 1)
{
SendClientMessage(playerid, COLOR_GREY, "You have to be rank 5 to use this command!");
return 1;
}
if (PlayerInfo[playerid][pRoadblock] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You haven't deployed a roadblock!");
return 1;
}
RemoveRoadblock(playerid);
SendClientMessage(playerid, COLOR_GREEN, "Roadblock removed successfully.");
return 1;
}
if(strcmp(cmdtext, "/roadunblockall", true)==0 || strcmp(cmdtext, "/rrball", true)==0)
{
if (PlayerInfo[playerid][pRank] >= 5 && PlayerInfo[playerid][pMember] || PlayerInfo[playerid][pLeader] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pRoadblock] != 0)
{
RemoveRoadblock(i);
}
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "HQ: All roadblocks in the area are to be disbanded immediately by order of %s.", sendername);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1)
{
SendClientMessage(i, TEAM_BLUE_COLOR, string);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You have to be rank 5+ or a police leader to remove all roadblocks!");
}
return 1;
}

como eu faзo para estes comandos funcionarem com a policia,fbi e o exercito ao inves de so a policia? me ajudem!! des de ja obrigada
Reply
#2

pawn Code:
if (PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pLeader] != 1) return SendClientMessage(playerid, COLOR_GREY, "You are not a cop!");
Esta linha estada definida para se o ID de sua facзгo for diferente de 1 vocк receberб a mensagem: You are not a cop!

para fazer as outras organizaзхes poderem usar o comando troque para isto:

pawn Code:
if (PlayerInfo[playerid][pMember] != 1 || PlayerInfo[playerid][pLeader] != 1 || PlayerInfo[playerid][pMember] != 2 || PlayerInfo[playerid][pLeader] != 2 || PlayerInfo[playerid][pMember] != 3 || PlayerInfo[playerid][pLeader] != 3) return SendClientMessage(playerid, COLOR_GREY, "You are not a cop!");
Veja se funcione.

Reply
#3

Um gajo que "cria FSs" nem sabe colocar mais uma faction a ter acesso ao comando. E ainda usa um nick copiado de outro membro. LOL E o que da, secзхes portuguesas/brasileiras. Sejam originais por amor de deus
Reply
#4

senhor portugues de portugal, eu so pedi ajuda por que so consegui colocar com uma faзгo mas se nao for ajudar nao responda o tropico
Reply
#5

Lol, ja й raro muita gente usar esse sistema de cmd lol.
Reply
#6

Quote:
Originally Posted by SergioSAMP
senhor portugues de portugal, eu so pedi ajuda por que so consegui colocar com uma faзгo mas se nao for ajudar nao responda o tropico
Peco desculpa, mas volto a repetir, sejam diferentes, sejam originais caramba.
Reply
#7

tem problema nao e ja mudei o meu nome nao sei se tem outro igual
Reply
#8

ah e aquela sua ilha em lv e muito legal
Reply
#9

Estou pesando em criar um game mode quem tiver disposto a me ajudar mande seu comando fs qualquer coisa para min e colocarei seu nome nos creditos
Reply
#10

Tripe-post, nгo sabe editar? -.-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)