if(strcmp(cmd,"/setskin", true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(IsPlayerAdmin(playerid)){
new tmp[256];
new plid, skin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "Digite: /setskin [id] [skin]");
return 1;
}
plid = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Digite: /setskin [id] [skin]");
return 1;
}
if(IsPlayerConnected(plid)){
if(skin >= 0 && skin <= 299){
format(string, sizeof(string), "* O Administrador %s (%d) setou sua skin para: %d.", aname, playerid, skin);
SendClientMessage(plid, Blue, string);
SetPlayerSkin(plid,skin);
dini_IntSet(file2, "Skin", skin);
return 1;
}else{
SendClientMessage(playerid, Vermelho, "(ERRO) Jogador nгo conectado.");
return 1;
}
}
}
}
if(strcmp(cmd,"/setskin", true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(IsPlayerAdmin(playerid))
{
new tmp[256];
new plid, skin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "Digite: /setskin [id] [skin]");
return 1;
}
plid = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "Digite: /setskin [id] [skin]");
return 1;
}
skin = strval(tmp);
if(IsPlayerConnected(plid))
{
if(skin >= 0 && skin <= 299)
{
format(string, sizeof(string), "* O Administrador %s (%d) setou sua skin para: %d.", aname, playerid, skin);
SendClientMessage(plid, Blue, string);
SetPlayerSkin(plid,skin);
dini_IntSet(file2, "Skin", skin);
return 1;
}
else
{
SendClientMessage(playerid, Vermelho, "(ERRO) Jogador nгo conectado.");
return 1;
}
}
}
}
pawn Код:
|