Eu tentei adptar ele ao meu gm, mais deu 26 Erros.
Mais nao consegui achar. Se alguem que tem alto conhecimento poder me ajudar o code й o abaixo.
PHP код:
if(strcmp(cmd, "/usardrogas", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /usardrogas [Maconha, Cocaina, Crack]");
return 1;
}
new droga[8];
if(strcmp(droga, "maconha", true) == 0)
{
if(PlayerInfo[playerid][pDrogas] > 1)
{
PlayerStoned[playerid] += 1;
if(PlayerStoned[playerid] >= 3) { GameTextForPlayer(playerid,"~w~Vocк estб~n~~y~Chapado",4000,1); }
new Float:PlayersArmour;
GetPlayerArmour(playerid,PlayersArmour);
PlayerInfo[playerid][pDrogas] -= 2;
new Dmelhoria = 1 * PlayerInfo[playerid][pDrugPerk]; Dmelhoria += 2;
if(PlayersArmour >= 100)
{
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid,COLOR_LIGHTRED,"* Vocк nгo pode mais usar drogas!");
return 1;
}
else
{
SetPlayerArmour(playerid, PlayersArmour + Dmelhoria);
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s fumou maconha.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo tem 2 gramas de maconha.");
return 1;
}
if(strcmp(droga, "cocaina", true) == 0)
{
if(PlayerInfo[playerid][pDrogas2] > 1)
{
PlayerStoned[playerid] += 1;
if(PlayerStoned[playerid] >= 3) { GameTextForPlayer(playerid,"~w~Vocк estб~n~~y~Cherado",4000,1); }
new Float:PlayersArmour;
GetPlayerArmour(playerid,PlayersArmour);
PlayerInfo[playerid][pDrogas2] -= 2;
new Dmelhoria = 1 * PlayerInfo[playerid][pDrugPerk]; Dmelhoria += 2;
if(playersArmour >= 100)
{
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid,COLOR_LIGHTRED,"* Vocк nгo pode mais usar drogas!");
return 1;
}
else
{
SetPlayerArmour(playerid, PlayersArmour + Dmelhoria);
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s cheirou cocaina.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo tem 2 carrerinha de cocaina.");
return 1;
}
if(strcmp(droga, "crack", true) == 0)
{
if(PlayerInfo[playerid][pDrogas3] > 1)
{
PlayerStoned[playerid] += 1;
if(PlayerStoned[playerid] >= 3) { GameTextForPlayer(playerid,"~w~Vocк estб~n~~y~Noiado",4000,1); }
new Float:PlayersArmour;
GetPlayerArmour(playerid,PlayersArmour);
PlayerInfo[playerid][pDrogas2] -= 3;
new Dmelhoria = 1 * PlayerInfo[playerid][pDrugPerk]; Dmelhoria += 2;
if(playersArmour >= 100)
{
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid,COLOR_LIGHTRED,"* Vocк nгo pode mais usar drogas!");
return 1;
}
else
{
SetPlayerArmour(playerid, PlayersArmour + Dmelhoria);
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s fumou crack.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo tem 2 pedra de crack.");
return 1;
}
return 1;
}
Existe programas que acham a falta de chaves ( } ) automaticamente.