new bopeativado[MAX_PLAYERS]; |
bopeativado[playerid] = 0; |
if(strcmp(cmd, "/ativarbope", true) == 0) { if(IsPlayerConnected(playerid)) { if(bopeativado[playerid] == 1) { SendClientMessage(playerid, COLOR_GREY, "O BOPE jб estб ativado!"); return 1; } if(PlayerInfo[playerid][pLider] == 1) { bopeativado[playerid] == 1; SendClientMessage(playerid,COLOR_GREY,"Vocк ativou o BOPE."); return 1; } } } return 1; } if(strcmp(cmd, "/desativarbope", true) == 0) { if(IsPlayerConnected(playerid)) { if(bopeativado[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, "O BOPE jб estб desativado!"); return 1; } if(PlayerInfo[playerid][pLider] == 1) { bopeativado[playerid] == 0; SendClientMessage(playerid,COLOR_GREY,"Vocк desativou o BOPE."); return 1; } } } return 1; } |
if(strcmp(cmd, "/ifbope", true) == 0) { if(IsPlayerConnected(playerid)) { if(bopeativado[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, "O equipamento do BOPE nгo estб ativado!"); return 1; } if(PlayerToPoint(10.0, playerid,255.1426,75.9933,1003.6406)) { if(PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1) { ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 25, 80); GivePlayerWeapon(playerid, 31, 200); GivePlayerWeapon(playerid, 17, 10); SetPlayerArmour(playerid, 100); GetPlayerName(playerid,sendername,sizeof(sendernam e)); format(string, sizeof(string), " O oficial %s pegou seu equipamento do BOPE.", sendername, playerid); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); return 1; } } } return 1; } if(strcmp(cmd, "/sniperbope", true) == 0) { if(IsPlayerConnected(playerid)) { if(bopeativado[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, "O equipamento do BOPE nгo estб ativado!"); return 1; } if(PlayerToPoint(10.0, playerid,255.1426,75.9933,1003.6406)) { if(PlayerInfo[playerid][pMembro] == 1 && PlayerInfo[playerid][pCargo] < 5 || PlayerInfo[playerid][pLider] == 1 && PlayerInfo[playerid][pCargo] < 5) { ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 24, 30); GivePlayerWeapon(playerid, 34, 50); GivePlayerWeapon(playerid, 17, 10); SetPlayerArmour(playerid, 100); GetPlayerName(playerid,sendername,sizeof(sendernam e)); format(string, sizeof(string), " O oficial %s pegou seu equipamento do BOPE SNIPER.", sendername, playerid); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); return 1; } } } return 1; } |
PlayerInfo[playerid][pLider]
CMD:ativarbope(playerid, params[])
{
if(bopeativado[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "O BOPE jб estб ativado!");
}
if(PlayerInfo[playerid][pLider] == 1)
{
bopeativado[playerid] == 1;
SendClientMessage(playerid,COLOR_GREY,"Vocк ativou o BOPE.");
}
return 1;
}
CMD:desactivarbope(playerid, params[])
{
if(bopeativado[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "O BOPE jб estб desativado!");
}
if(PlayerInfo[playerid][pLider] == 1)
{
bopeativado[playerid] == 0;
SendClientMessage(playerid,COLOR_GREY,"Vocк desativou o BOPE.");
}
return 1;
}
CMD:ifbope(playerid, params[])
{
if(bopeativado[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "O equipamento do BOPE nгo estб ativado!");
}
if(PlayerToPoint(10.0, playerid,255.1426,75.9933,1003.6406))
{
if(PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 25, 80);
GivePlayerWeapon(playerid, 31, 200);
GivePlayerWeapon(playerid, 17, 10);
SetPlayerArmour(playerid, 100);
GetPlayerName(playerid,sendername,sizeof(sendernam e));
format(string, sizeof(string), " O oficial %s pegou seu equipamento do BOPE.", sendername, playerid);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
}
}
return 1;
}
CMD:sniperbope(playerid, params[])
{
if(bopeativado[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "O equipamento do BOPE nгo estб ativado!");
}
if(PlayerToPoint(10.0, playerid,255.1426,75.9933,1003.6406))
{
if(PlayerInfo[playerid][pMembro] == 1 && PlayerInfo[playerid][pCargo] < 5 || PlayerInfo[playerid][pLider] == 1 && PlayerInfo[playerid][pCargo] < 5)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 30);
GivePlayerWeapon(playerid, 34, 50);
GivePlayerWeapon(playerid, 17, 10);
SetPlayerArmour(playerid, 100);
GetPlayerName(playerid,sendername,sizeof(sendernam e));
format(string, sizeof(string), " O oficial %s pegou seu equipamento do BOPE SNIPER.", sendername, playerid);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
}
}
return 1;
}
Use as tags [pawn][/pawn*]
Primeira coisa: Se й um comando, й УBVIO que o jogador vai estar conectado? Entгo para quк usa IsPlayerConnected? Segunda: Use ZCMD, mais legнvel, prбtico e rбpido. Terceiro: Idente seus cуdigos Os comandos todos em ZCMD, mais legнveis e sem o IsPlayerConnected. pawn Код:
|
// topo
new bopeativado[MAX_PLAYERS];
// OnPlayerConnect
bopeativado[playerid] = false;
// Comandos
if(strcmp(cmd, "/ativarbope", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(bopeativado[playerid] == true) return SendClientMessage(playerid, COLOR_GREY, "O BOPE jб estб ativado!");
if(PlayerInfo[playerid][pLider] == false)
{
bopeativado[playerid] == true;
SendClientMessage(playerid,COLOR_GREY,"Vocк ativou o BOPE.");
}
}
return true;
}
if(strcmp(cmd, "/desativarbope", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(bopeativado[playerid] == false) return SendClientMessage(playerid, COLOR_GREY, "O BOPE jб estб desativado!");
if(PlayerInfo[playerid][pLider] == true)
{
bopeativado[playerid] == false;
SendClientMessage(playerid,COLOR_GREY,"Vocк desativou o BOPE.");
}
}
return true;
}
if(strcmp(cmd, "/ifbope", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(bopeativado[playerid] == false) return SendClientMessage(playerid, COLOR_GREY, "O equipamento do BOPE nгo estб ativado!");
if(PlayerToPoint(10.0, playerid,255.1426,75.9933,1003.6406))
{
if(PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1)
{
new nname[MAX_PLAYER_NAME];
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 25, 80);
GivePlayerWeapon(playerid, 31, 200);
GivePlayerWeapon(playerid, 17, 10);
SetPlayerArmour(playerid, 100);
GetPlayerName(playerid,nname,sizeof(nname));
format(string, sizeof(string), " O oficial %s pegou seu equipamento do BOPE.", nname, playerid);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
}
}
}
return 1;
}
if(strcmp(cmd, "/sniperbope", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(bopeativado[playerid] == false) return SendClientMessage(playerid, COLOR_GREY, "O equipamento do BOPE nгo estб ativado!");
if(PlayerToPoint(10.0, playerid,255.1426,75.9933,1003.6406))
{
if(PlayerInfo[playerid][pMembro] == 1 && PlayerInfo[playerid][pCargo] < 5 || PlayerInfo[playerid][pLider] == 1 && PlayerInfo[playerid][pCargo] < 5)
{
new nname[MAX_PLAYER_NAME];
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 30);
GivePlayerWeapon(playerid, 34, 50);
GivePlayerWeapon(playerid, 17, 10);
SetPlayerArmour(playerid, 100);
GetPlayerName(playerid,nname,sizeof(nname));
format(string, sizeof(string), " O oficial %s pegou seu equipamento do BOPE SNIPER.", nname, playerid);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
}
}
}
return 1;
}
o erro dele e o excesso de chaves, tenta isto
pawn Код:
|
C:\Users\Tiago\Desktop\Intense Life\pawno\ULTRA2.pwn(36191) : warning 213: tag mismatch
if(bopeativado[playerid] == true) return SendClientMessage(playerid, COLOR_GREY, "O BOPE jб estб ativado!");
C:\Users\Tiago\Desktop\Intense Life\pawno\ULTRA2.pwn(36193) : warning 213: tag mismatch
if(PlayerInfo[playerid][pLider] == false)
C:\Users\Tiago\Desktop\Intense Life\pawno\ULTRA2.pwn(36195) : warning 213: tag mismatch
bopeativado[playerid] == true;
C:\Users\Tiago\Desktop\Intense Life\pawno\ULTRA2.pwn(36195) : warning 215: expression has no effect
bopeativado[playerid] == true;
C:\Users\Tiago\Desktop\Intense Life\pawno\ULTRA2.pwn(36206) : warning 213: tag mismatch
if(bopeativado[playerid] == false) return SendClientMessage(playerid, COLOR_GREY, "O BOPE jб estб desativado!");
C:\Users\Tiago\Desktop\Intense Life\pawno\ULTRA2.pwn(36208) : warning 213: tag mismatch
if(PlayerInfo[playerid][pLider] == true)
C:\Users\Tiago\Desktop\Intense Life\pawno\ULTRA2.pwn(36210) : warning 213: tag mismatch
bopeativado[playerid] == false;
C:\Users\Tiago\Desktop\Intense Life\pawno\ULTRA2.pwn(36210) : warning 215: expression has no effect
bopeativado[playerid] == false;
C:\Users\Tiago\Desktop\Intense Life\pawno\ULTRA2.pwn(36221) : warning 213: tag mismatch
if(bopeativado[playerid] == false) return SendClientMessage(playerid, COLOR_GREY, "O equipamento do BOPE nгo estб ativado!");
C:\Users\Tiago\Desktop\Intense Life\pawno\ULTRA2.pwn(36246) : warning 213: tag mismatch
if(bopeativado[playerid] == false) return SendClientMessage(playerid, COLOR_GREY, "O equipamento do BOPE nгo estб ativado!");
Ta dando varios warnings! =\
E o /ativarbope n ta funcionando =\
eu queria q qnd o lider ativa-se todos os membros pude-sem pegar obope e dps ele desativava, mas n ta pegando =\
new bopeativado[MAX_PLAYERS];
new bopeativado[MAX_PLAYERS] = 0;