21.01.2012, 11:22
(
Последний раз редактировалось Shadoww5; 21.01.2012 в 12:32.
)
Testa:
PHP код:
if(strcmp(cmd,"/darguardiao", true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "aAdmin") == 4 )
return SendClientMessage(playerid, Vermelho, "[INFO] Vocк nao e um admin!");
if(!(dini_Int(file, "aAdmin") == 4 || IsPlayerAdmin(playerid)))
return 1;
new tmp[128], plid, skin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
return SendClientMessage(playerid, Vermelho, "Digite: /darguardiao [id] [35]");
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
return SendClientMessage(playerid, Vermelho, "Digite: /darguardiao [id] [35]");
skin = strval(tmp);
if(!IsPlayerConnected(plid))
return SendClientMessage(playerid, Vermelho, "[INFO] Jogador nгo conectado.");
new pname[MAX_PLAYER_NAME];
format(file2, sizeof(file2), PASTA_CONTAS, pname);
dini_IntSet(file2, "Guardiao",1);
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
format(string, sizeof(string), "[INFO] O Administrador %s (%d) deu a Vocк Guardiao Para ver os Comandos Use: /cguardiao", aname, playerid, skin);
SendClientMessage(plid, GREEN, string);
format(string, sizeof(string), "[INFO] Vocк deu a %s(ID: %d) Guardiгo! .", pname, plid, skin);
SendClientMessage(playerid, AzuL4, string);
dini_IntSet(file2, "Profissao", skin);
return SpawnPlayer(plid);
}
//-------------------------------------------------------------------------------------------------------
if(!strcmp(cmdtext, "/guardioes", true))
{
SendClientMessage(playerid,GREEN, "[»] .:: Guardioes Online ::. [»]");
new count;
for(new i, p = GetMaxPlayers(); i < p; i++)
{
if(IsPlayerConnected(i))
{
new str[36];
GetPlayerName(i, str, 35);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(dini_Int(file, "Profissao") != Guardiao)
continue;
format(str,sizeof(str),"%s (%d)", str,i);
SendClientMessage(playerid, COLOR_WHITE, str);
count++;
}
}
if(count == 0)
return SendClientMessage(playerid, Vermelho, "Nгo hб guardiхes online!");
return 1;
}