Noob-Rp
https://forum.noob-rp.ru/

/iwep
https://forum.noob-rp.ru/viewtopic.php?t=71
Страница 1 из 1

Автор:  Samuel_Lecompte [ 17 июл 2015, 11:56 ]
Заголовок сообщения:  /iwep

Написал команду /iwep, вроде полная копия Samp-Rp.
Код:
CMD:iwep(playerid, params[]) { if(!CheckAdminLevel(playerid, 2)) return 1; if(sscanf(params, "u",params[0])) return SendClientMessage(playerid, COLOR_WHITE, " Введите: /iwep [playerid]"); if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, COLOR_GREY, " Игрок не найден."); new iwep[550], Gun[13], Ammo[13], ServerPatrons[13], string[550]; for (new i = 0; i < 13; i++) { GetPlayerWeaponData(params[0], i, Gun[i], Ammo[i]); } for(new i=0;i<13;i++) { ServerPatrons[i] = AGunAmmo[params[0]][i]; } new Float:onepercent, shotpercent, Float:toneshotp, tshotprocent; if(NumberShot[params[0]]) { onepercent = float(NumberShotTarget[params[0]])/float(NumberShot[params[0]]); shotpercent = floatround(onepercent*100); } if(TimeNumberShot[params[0]]) { toneshotp = float(TimeNumberShotTarget[params[0]])/float(TimeNumberShot[params[0]]); tshotprocent = floatround(toneshotp*100); } format(iwep,sizeof(iwep),"{4075FF}%s\n\n",getName(params[0])); format(iwep,sizeof(iwep),"{FFFF00}State: %d\n",GetPlayerState(params[0])); format(iwep,sizeof(iwep),"{FF6347}Выстрелов за сессию: %d. Попаданий: %d. Процент: %d\n",NumberShot[params[0]],NumberShotTarget[params[0]],shotpercent); format(iwep,sizeof(iwep),"{FF6347}Выстрелов за 10мин: %d. Попаданий: %d. Процент: %d\n",TimeNumberShot[params[0]],TimeNumberShotTarget[params[0]],tshotprocent); format(iwep,sizeof(iwep),"{C2A2DA}[Weapon][ClientGuns][ServerGuns]\n"); format(iwep,sizeof(iwep),"{C2A2DA}0\tW: %d CG: %d SG: %d\n",Gun[0],Ammo[0],ServerPatrons[0]); format(iwep,sizeof(iwep),"{C2A2DA}1\tW: %d CG: %d SG: %d\n",Gun[0],Ammo[0],ServerPatrons[0]); format(iwep,sizeof(iwep),"{C2A2DA}2\tW: %d CG: %d SG: %d\n",Gun[0],Ammo[0],ServerPatrons[0]); format(iwep,sizeof(iwep),"{C2A2DA}3\tW: %d CG: %d SG: %d\n",Gun[0],Ammo[0],ServerPatrons[0]); format(iwep,sizeof(iwep),"{C2A2DA}4\tW: %d CG: %d SG: %d\n",Gun[0],Ammo[0],ServerPatrons[0]); format(iwep,sizeof(iwep),"{C2A2DA}5\tW: %d CG: %d SG: %d\n",Gun[0],Ammo[0],ServerPatrons[0]); format(iwep,sizeof(iwep),"{C2A2DA}6\tW: %d CG: %d SG: %d\n",Gun[0],Ammo[0],ServerPatrons[0]); format(iwep,sizeof(iwep),"{C2A2DA}7\tW: %d CG: %d SG: %d\n",Gun[0],Ammo[0],ServerPatrons[0]); format(iwep,sizeof(iwep),"{C2A2DA}8\tW: %d CG: %d SG: %d\n",Gun[0],Ammo[0],ServerPatrons[0]); format(iwep,sizeof(iwep),"{C2A2DA}9\tW: %d CG: %d SG: %d\n",Gun[0],Ammo[0],ServerPatrons[0]); format(iwep,sizeof(iwep),"{C2A2DA}10\tW: %d CG: %d SG: %d\n",Gun[0],Ammo[0],ServerPatrons[0]); format(iwep,sizeof(iwep),"{C2A2DA}11\tW: %d CG: %d SG: %d\n",Gun[0],Ammo[0],ServerPatrons[0]); format(iwep,sizeof(iwep),"{C2A2DA}12\tW: %d CG: %d SG: %d",Gun[0],Ammo[0],ServerPatrons[0]); strcat(string,iwep); ShowPlayerDialog(playerid,DIALOGINFO,DIALOG_STYLE_MSGBOX,"Информация оружия",string,"Закрыть",""); return true; }

Автор:  sanek [ 17 июл 2015, 12:53 ]
Заголовок сообщения:  Re: /iwep

Добавил

Автор:  James_Reed [ 11 авг 2015, 03:07 ]
Заголовок сообщения:  Re: /iwep

Исправленная /iwep:
Код:
CMD:iwep(playerid, params[]) { if(!CheckAdminLevel(playerid, 2)) return 1; if(sscanf(params, "u",params[0])) return SendClientMessage(playerid, COLOR_WHITE, " Введите: /iwep [playerid/ник]"); if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, COLOR_GREY, " Игрок не найден."); new iwep[256], Gun[13], Ammo[13], ServerPatrons[13], string[2000]; for (new i = 0; i < 13; i++) { GetPlayerWeaponData(params[0], i, Gun[i], Ammo[i]); } for(new i=0;i<13;i++) { ServerPatrons[i] = AGunAmmo[params[0]][Gun[i]]; } new Float:onepercent, shotpercent, Float:toneshotp, tshotprocent; if(NumberShot[params[0]]) { onepercent = float(NumberShotTarget[params[0]])/float(NumberShot[params[0]]); shotpercent = floatround(onepercent*100); } if(TimeNumberShot[params[0]]) { toneshotp = float(TimeNumberShotTarget[params[0]])/float(TimeNumberShot[params[0]]); tshotprocent = floatround(toneshotp*100); } format(iwep,sizeof(iwep),"{33CC00}%s\n\n",getName(params[0])), strcat(string,iwep); format(iwep,sizeof(iwep),"{ffff00}State: %d\n",GetPlayerState(params[0])), strcat(string,iwep); format(iwep,sizeof(iwep),"{FF0000}Выстрелов за сессию: %d. Попаданий: %d. Процент: %d\n",NumberShot[params[0]],NumberShotTarget[params[0]],shotpercent), strcat(string,iwep); format(iwep,sizeof(iwep),"{FF0000}Выстрелов за 10мин: %d. Попаданий: %d. Процент: %d\n",TimeNumberShot[params[0]],TimeNumberShotTarget[params[0]],tshotprocent), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}[Weapon][ClientGuns][ServerGuns]\n"), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}0\tW: %d CG: %d SG: %d\n",Gun[0],Ammo[0],ServerPatrons[0]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}1\tW: %d CG: %d SG: %d\n",Gun[1],Ammo[1],ServerPatrons[1]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}2\tW: %d CG: %d SG: %d\n",Gun[2],Ammo[2],ServerPatrons[2]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}3\tW: %d CG: %d SG: %d\n",Gun[3],Ammo[3],ServerPatrons[3]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}4\tW: %d CG: %d SG: %d\n",Gun[4],Ammo[4],ServerPatrons[4]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}5\tW: %d CG: %d SG: %d\n",Gun[5],Ammo[5],ServerPatrons[5]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}6\tW: %d CG: %d SG: %d\n",Gun[6],Ammo[6],ServerPatrons[6]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}7\tW: %d CG: %d SG: %d\n",Gun[7],Ammo[7],ServerPatrons[7]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}8\tW: %d CG: %d SG: %d\n",Gun[8],Ammo[8],ServerPatrons[8]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}9\tW: %d CG: %d SG: %d\n",Gun[9],Ammo[9],ServerPatrons[9]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}10\tW: %d CG: %d SG: %d\n",Gun[10],Ammo[10],ServerPatrons[10]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}11\tW: %d CG: %d SG: %d\n",Gun[11],Ammo[11],ServerPatrons[11]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}12\tW: %d CG: %d SG: %d",Gun[12],Ammo[12],ServerPatrons[12]), strcat(string,iwep); ShowPlayerDialog(playerid,DIALOGINFO,DIALOG_STYLE_MSGBOX,"Информация оружия",string,"Закрыть",""); return 1; }

Автор:  Samuel_Lecompte [ 28 окт 2015, 09:03 ]
Заголовок сообщения:  Re: /iwep

Цитата:
Исправленная /iwep:
Код:
CMD:iwep(playerid, params[]) { if(!CheckAdminLevel(playerid, 2)) return 1; if(sscanf(params, "u",params[0])) return SendClientMessage(playerid, COLOR_WHITE, " Введите: /iwep [playerid/ник]"); if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, COLOR_GREY, " Игрок не найден."); new iwep[256], Gun[13], Ammo[13], ServerPatrons[13], string[2000]; for (new i = 0; i < 13; i++) { GetPlayerWeaponData(params[0], i, Gun[i], Ammo[i]); } for(new i=0;i<13;i++) { ServerPatrons[i] = AGunAmmo[params[0]][Gun[i]]; } new Float:onepercent, shotpercent, Float:toneshotp, tshotprocent; if(NumberShot[params[0]]) { onepercent = float(NumberShotTarget[params[0]])/float(NumberShot[params[0]]); shotpercent = floatround(onepercent*100); } if(TimeNumberShot[params[0]]) { toneshotp = float(TimeNumberShotTarget[params[0]])/float(TimeNumberShot[params[0]]); tshotprocent = floatround(toneshotp*100); } format(iwep,sizeof(iwep),"{33CC00}%s\n\n",getName(params[0])), strcat(string,iwep); format(iwep,sizeof(iwep),"{ffff00}State: %d\n",GetPlayerState(params[0])), strcat(string,iwep); format(iwep,sizeof(iwep),"{FF0000}Выстрелов за сессию: %d. Попаданий: %d. Процент: %d\n",NumberShot[params[0]],NumberShotTarget[params[0]],shotpercent), strcat(string,iwep); format(iwep,sizeof(iwep),"{FF0000}Выстрелов за 10мин: %d. Попаданий: %d. Процент: %d\n",TimeNumberShot[params[0]],TimeNumberShotTarget[params[0]],tshotprocent), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}[Weapon][ClientGuns][ServerGuns]\n"), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}0\tW: %d CG: %d SG: %d\n",Gun[0],Ammo[0],ServerPatrons[0]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}1\tW: %d CG: %d SG: %d\n",Gun[1],Ammo[1],ServerPatrons[1]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}2\tW: %d CG: %d SG: %d\n",Gun[2],Ammo[2],ServerPatrons[2]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}3\tW: %d CG: %d SG: %d\n",Gun[3],Ammo[3],ServerPatrons[3]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}4\tW: %d CG: %d SG: %d\n",Gun[4],Ammo[4],ServerPatrons[4]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}5\tW: %d CG: %d SG: %d\n",Gun[5],Ammo[5],ServerPatrons[5]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}6\tW: %d CG: %d SG: %d\n",Gun[6],Ammo[6],ServerPatrons[6]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}7\tW: %d CG: %d SG: %d\n",Gun[7],Ammo[7],ServerPatrons[7]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}8\tW: %d CG: %d SG: %d\n",Gun[8],Ammo[8],ServerPatrons[8]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}9\tW: %d CG: %d SG: %d\n",Gun[9],Ammo[9],ServerPatrons[9]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}10\tW: %d CG: %d SG: %d\n",Gun[10],Ammo[10],ServerPatrons[10]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}11\tW: %d CG: %d SG: %d\n",Gun[11],Ammo[11],ServerPatrons[11]), strcat(string,iwep); format(iwep,sizeof(iwep),"{ff00ff}12\tW: %d CG: %d SG: %d",Gun[12],Ammo[12],ServerPatrons[12]), strcat(string,iwep); ShowPlayerDialog(playerid,DIALOGINFO,DIALOG_STYLE_MSGBOX,"Информация оружия",string,"Закрыть",""); return 1; }
Удаляем
Код:
for(new i=0;i<13;i++) { ServerPatrons[i] = AGunAmmo[params[0]][Gun[i]]; }
и
Код:
new ServerPatrons[13];

Добавляем вот это
Код:
#define ServerPatrons[%0] AGunAmmo[params[0]][Gun[%0]]
Замена
Код:
new iwep[256], Gun[13], Ammo[13], ServerPatrons[13], string[2000];
на
Код:
new iwep[55+10], Gun[12+1], Ammo[12+1], string[725+1];

Страница 1 из 1 Часовой пояс: UTC+03:00 UTC + 3 часа
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/