Vlad Breezy
Ученик
Добрый вечер, можете помочь сделать так, что-бы выдавались все команды сразу. А не по очереди прописывать 18 раз.
C++:
CMD:infosetcmd(playerid, params[])
{
if(PI[playerid][pAdmin] < 11 || dostup[playerid] == 0) return true;
if(!GetString(player_name[playerid],FD1) && !GetString(player_name[playerid],FD2) && !GetString(player_name[playerid],FD3)) return 1;
new string[3000];
format(string, sizeof(string), "\
"C"[1]"W" /ban /sban /offban /unban\n\
"C"[2]"W" /iban /ioffban /rban /unrban\n\
"C"[3]"W" /warn /unwarn /offwarn /offunwarn\n\
"C"[4]"W" /hbject /hbjectedit /getobjectpos /cobj /dcobject /obj /dobject /eobject\n\
"C"[5]"W" /amusic\n\
"C"[6]"W" /tempzone\n\
"C"[7]"W" /awarn /aunwarn\n\
"C"[8]"W" /makeleader\n\
"C"[9]"W" /captfreeze\n\
"C"[10]"W" /templeader\n\
"C"[11]"W" /setbizmafia\n\
"C"[12]"W" /fin\n\
"C"[13]"W" /agiverank\n\
"C"[14]"W" /setmats\n\
"C"[15]"W" /makesupport\n\
"C"[16]"W" /setyoutube\n\
"C"[17]"W" /makedj\n\
"C"[18]"W" /asettax");
D(playerid,DIALOG_NONE,DSM,"Номера пакетов",string,"Закрыть","");
return true;
}
CMD:setcmd(playerid, params[])
{
if(PI[playerid][pAdmin] < 11 || dostup[playerid] == 0) return true;
if(!GetString(player_name[playerid],FD1) && !GetString(player_name[playerid],FD2) && !GetString(player_name[playerid],FD3)) return 1;
{
new stat,amount,giveplayerid;
if(sscanf(params, "udd",giveplayerid,stat,amount))
{
SendEsp(playerid, "/setcmd [id] [номер пакета] [1 - выдать | 0 - забрать]");
SendClientMessage(playerid, COLOR_GRAD4, ""C"|"W" Номера пакетов /infosetcmd");
return true;
}
if(!IsPlayerConnected(giveplayerid)) return true;
if(giveplayerid == INVALID_PLAYER_ID) return true;
switch (stat)
{
case 1: {
PI[giveplayerid][pBanDostup] = amount,UpdatePlayerData(giveplayerid,"pBanDostup",amount);
}
case 2: {
PI[giveplayerid][piBanDostup] = amount,UpdatePlayerData(giveplayerid,"piBanDostup",amount);
}
case 3: {
PI[giveplayerid][pWarnDostup] = amount,UpdatePlayerData(giveplayerid,"pWarnDostup",amount);
}
case 4: {
PI[giveplayerid][pObjectDostup] = amount,UpdatePlayerData(giveplayerid,"pObjectDostup",amount);
}
case 5: {
PI[giveplayerid][pAmusicDostup] = amount,UpdatePlayerData(giveplayerid,"pAmusicDostup",amount);
}
case 6: {
PI[giveplayerid][pZoneDostup] = amount,UpdatePlayerData(giveplayerid,"pZoneDostup",amount);
}
case 7: {
PI[giveplayerid][pAwarnDostup] = amount,UpdatePlayerData(giveplayerid,"pAwarnDostup",amount);
}
case 8: {
PI[giveplayerid][pMakeleaderDostup] = amount,UpdatePlayerData(giveplayerid,"pMakeleaderDostup",amount);
}
case 9: {
PI[giveplayerid][pCaptfreezeDostup] = amount,UpdatePlayerData(giveplayerid,"pCaptfreezeDostup",amount);
}
case 10: {
PI[giveplayerid][pTempleaderDostup] = amount,UpdatePlayerData(giveplayerid,"pTempleaderDostup",amount);
}
case 11: {
PI[giveplayerid][pSetbizmafiaDostup] = amount,UpdatePlayerData(giveplayerid,"pSetbizmafiaDostup",amount);
}
case 12: {
PI[giveplayerid][pFinDostup] = amount,UpdatePlayerData(giveplayerid,"pFinDostup",amount);
}
case 13: {
PI[giveplayerid][pAgiverankDostup] = amount,UpdatePlayerData(giveplayerid,"pAgiverankDostup",amount);
}
case 14: {
PI[giveplayerid][pSetmatsDostup] = amount,UpdatePlayerData(giveplayerid,"pSetmatsDostup",amount);
}
case 15: {
PI[giveplayerid][pMakesupportDostup] = amount,UpdatePlayerData(giveplayerid,"pMakesupportDostup",amount);
}
case 16: {
PI[giveplayerid][pSetyoutubeDostup] = amount,UpdatePlayerData(giveplayerid,"pSetyoutubeDostup",amount);
}
case 17: {
PI[giveplayerid][pMakedjDostup] = amount,UpdatePlayerData(giveplayerid,"pMakedjDostup",amount);
}
case 18: {
PI[giveplayerid][pAsettaxDostup] = amount,UpdatePlayerData(giveplayerid,"pAsettaxDostup",amount);
}
}
SendOk(playerid, "Вы успешно выдали пакет команд.");
new str[1000];
format(str, sizeof(str), "[A] %s[%d] выдал/забрал пакет %s[%d] номер %d",player_name[playerid],playerid,player_name[giveplayerid],giveplayerid,stat,amount);
SendAdminMessage(COLOR_GREY, str);
}
return true;
}
Последнее редактирование модератором:
