if(strcmp(cmd,"/daradmin",true)==0)
{
if(PlayerInfo[playerid][pAdmin] >= 1341)//
{
new file[300];
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GRAD1,"USE: /daradmin [Nick]");
return 1;
}
format(file, sizeof(file), "/listaN/%s.ini", tmp);
if(!fexist(file))
{
dini_Create(file);
SendClientMessage(playerid,COLOR_THE,"Admin colocado com sucesso");
new plrIP[16];
if(IsPlayerConnected(playerid))
{
GetPlayerIp(playerid, plrIP, sizeof(plrIP));
format(file, sizeof(file), "/listaN/%s.ini", plrIP);
if(!fexist(file))
{
dini_Create(file);
}
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD1,"Este nick ja esta em nossa lista de adm!!!");
}
}
return 1;
}
if(strcmp(cmd,"/daradmin",true)==0)
{
if(PlayerInfo[playerid][pAdmin] >= 1341)
{
new file[60];
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GRAD1,"USE: /daradmin [Nick]");
return 1;
}
new File: hFile = fopen(file, io_read);
if(!hFile)
{
format(file, sizeof(file), "/listaN/%s.ini", tmp);
dini_Create(file);
SendClientMessage(playerid, 0xFFFFFFAA, "[INFO]: Admin criado.");
return 1;
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "Esse nick jб existe.");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/daradmin", true) == 0) { if (IsPlayerAdmin(playerid)) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USO: /daradmin [playerid/Parte-do-Nick] [level(1-5000)]"); return 1; } new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); level = strval(tmp); if (PlayerInfo[playerid][pAdmin] >= 5000 || IsPlayerAdmin(playerid)) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[para1][pAdmin] = level; printf("|ADMIN|: %s promoveu %s para administrador no nivel %d.", sendername, giveplayer, level); format(string, sizeof(string), "Vocк foi promovido a Colaborador, no nнvel %d pelo administrador %s.", level, sendername); SendClientMessage(para1, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "Vocк promoveu %s com nнvel %d.", giveplayer,level); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } } } else { SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo pode usar esse comando!"); } } return 1; } } |
C:\DOCUME~1\BPG\Desktop\MEUSER~1\PRACOL~1\bcla.pwn(12) : fatal error 100: cannot read from file: "LR"
//----------------------------------[MAKEADMIN]------------------------------------------------
if(strcmp(cmd, "/daradmin", true) == 0)
{
if (IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /daradmin [playerid/Parte-do-Nick] [level(1-5000)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 5000 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("|ADMIN|: %s promoveu %s para administrador no nivel %d.", sendername, giveplayer, level);
format(string, sizeof(string), "Vocк foi promovido a moderador, no nнvel %d pelo administrador %s.", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Vocк promoveu %s com nнvel %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo pode usar esse comando!");
}
}
return 1;
}
}
#include <LR>// ou #include "LR"