den4ik111 |
Дата: Пятница, 12.04.2013, 18:20 | Сообщение # 1
|
Новичок
Сообщений: 12
Статус: Offline
|
Код if(strcmp(cmd, "/usedrugs", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Введите: /usedrugs [количество]"); new moneys2 = strval(tmp); new Float:health; GetPlayerHealth(playerid, health); if(AddictionsTimer[playerid] != 0) return SendClientMessage(playerid, COLOR_GREY, "Нельзя употреблять наркотик слишком часто"); if(PlayerInfo[playerid][pDrugs] < moneys2) return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Недостаточно наркотиков!"); switch(moneys2) { case 1..3: { SetTimerEx("AddictionTimer", 60000, false, "i", playerid); SetPlayerHealthAC(playerid, health + moneys2+10*2); PlayerInfo[playerid][pHP] += moneys2+10*2; if(PlayerInfo[playerid][pHP] > 120) { SetPlayerHealthAC(playerid, 120); PlayerInfo[playerid][pHP] = 120; } } case 4..5: { if(PlayerInfo[playerid][pNarcoZavisimost] < 15000)return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Неверное количество"); SetTimerEx("AddictionTimer", 120000, false, "i", playerid); SetPlayerHealthAC(playerid, health + moneys2+13*2); PlayerInfo[playerid][pHP] += moneys2+13*2; if(PlayerInfo[playerid][pHP] > 130) { SetPlayerHealthAC(playerid, 130); PlayerInfo[playerid][pHP] = 130; } } case 6..8: { if(PlayerInfo[playerid][pNarcoZavisimost] < 23000)return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Неверное количество"); SetTimerEx("AddictionTimer", 180000, false, "i", playerid); SetPlayerHealthAC(playerid, health + moneys2+14*2); PlayerInfo[playerid][pHP] += moneys2+14*2; if(PlayerInfo[playerid][pHP] > 140) { SetPlayerHealthAC(playerid, 140); PlayerInfo[playerid][pHP] = 140; } } case 9,10: { if(PlayerInfo[playerid][pNarcoZavisimost] < 35000)return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Неверное количество"); SetTimerEx("AddictionTimer", 210000, false, "i", playerid); SetPlayerHealthAC(playerid, health + moneys2+15*2); PlayerInfo[playerid][pHP] += moneys2+15*2; if(PlayerInfo[playerid][pHP] > 150) { SetPlayerHealthAC(playerid, 150); PlayerInfo[playerid][pHP] = 150; } } case 11..15: { if(PlayerInfo[playerid][pNarcoZavisimost] < 50000)return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Неверное количество"); SetTimerEx("AddictionTimer", 300000, false, "i", playerid); SetPlayerHealthAC(playerid, health + moneys2+20*2); PlayerInfo[playerid][pHP] += moneys2+20*2; if(PlayerInfo[playerid][pHP] > 160) { SetPlayerHealthAC(playerid, 160); PlayerInfo[playerid][pHP] = 160; } } } PlayerInfo[playerid][pDrugs] -= moneys2; AddictionsTimer[playerid] = 1; SetTimerEx( "AddictionTimer", 10000, false, "i", playerid); format(string, sizeof(string), "(( Здоровье пополнено до: %d ))", PlayerInfo[playerid][pHP]); SendClientMessage(playerid, COLOR_WHITE,string); GetPlayerName(playerid, sendername, sizeof(sendername)); ApplyAnimation(playerid, "SMOKING", "M_smk_drag",4.1,0,0,0,0,0,1); format(string,sizeof(string), "употребил(a) наркотик"); SetPlayerChatBubble(playerid,string,COLOR_PURPLE,30.0,10000); format(string, sizeof(string), "%s употребил(a) наркотик", sendername); ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } return true; }
Скайп: denis.batrov
Сообщение отредактировал den4ik111 - Пятница, 12.04.2013, 18:21 |
|
|
|
yl |
Дата: Суббота, 13.04.2013, 00:02 | Сообщение # 2
|
Боец
Сообщений: 252
Статус: Offline
|
скопировано. Сейчас сделаю точный формат SRP Код if(strcmp(cmd, "/usedrugs", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Введите: /usedrugs [количество]"); new moneys2 = strval(tmp); new Float:health, Float:pribav; GetPlayerHealth(playerid, health); GetPlayerHealth(playerid, pribav); if(AddictionsTimer[playerid] != 0) return SendClientMessage(playerid, COLOR_GREY, "Нельзя употреблять наркотик слишком часто"); if(PlayerInfo[playerid][pDrugs] < moneys2) return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Недостаточно наркотиков!"); switch(moneys2) { case 1..3: { pribav=health+moneys2*10; if(pribav > 120) pribav = 120; } case 4..5: { if(PlayerInfo[playerid][pNarcoZavisimost] < 2000)return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Неверное количество"); pribav=health+moneys2*10; if(pribav > 130) pribav = 130; } case 6..8: { if(PlayerInfo[playerid][pNarcoZavisimost] < 3000)return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Неверное количество"); pribav=health+moneys2*10; if(pribav > 140) pribav = 140; } case 9,10: { if(PlayerInfo[playerid][pNarcoZavisimost] < 4000)return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Неверное количество"); pribav=health+moneys2*10; if(pribav > 150) pribav = 150; } case 11..15: { if(PlayerInfo[playerid][pNarcoZavisimost] < 5000)return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Неверное количество"); pribav=health+moneys2*10; if(pribav > 160) pribav = 160; } } PlayerInfo[playerid][pDrugs] -= moneys2; PlayerInfo[playerid][pNarcoZavisimost]+=moneys2*4; AddictionsTimer[playerid] = 1; SetTimerEx("AddictionTimer", moneys2*1000, false, "i", playerid); PlayerInfo[playerid][pHP]=pribav; SetPlayerHealthAC(playerid, pribav); format(string, sizeof(string), "(( Здоровье пополнено до: %d ))", PlayerInfo[playerid][pHP]); SendClientMessage(playerid, COLOR_WHITE,string); GetPlayerName(playerid, sendername, sizeof(sendername)); ApplyAnimation(playerid, "SMOKING", "M_smk_drag",4.1,0,0,0,0,0,1); format(string,sizeof(string), "употребил(a) наркотик"); SetPlayerChatBubble(playerid,string,COLOR_PURPLE,30.0,10000); format(string, sizeof(string), "%s употребил(a) наркотик", sendername); ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } return true; } Изменено: 1. Оптимизирован код. 2. Исправлен баг ( /usedrugs 15 = 40+15=65. Когда на самп-рп - /usedrugs 15 = 150). 3. Добавлена проверка на наркозависимость как на SRP+прибавляется столько-же.
УСЕ ПРОДАЮ, УСЕ ПОКУПАЮ. МАЙА МИЧТА - НАБАРЫЖЫТЪ 1КК ВИРТ ШТОБЫ КУПИТЬ СИБЕ ДОМ НУБ КЛАСА НА 11 СЕРВИРЕ И МЯСАВОСКУ
|
|
|
|
ernestocassano |
Дата: Суббота, 20.07.2013, 00:39 | Сообщение # 3
|
Любитель
Сообщений: 49
Статус: Offline
|
куда это встовлять я просто тока учусь
------------------------------ Нa CM 1482 дней -------------------------------
|
|
|
|
Nikita666 |
Дата: Четверг, 23.01.2014, 17:47 | Сообщение # 4
|
Новичок
Сообщений: 2
Статус: Offline
|
C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27112) : warning 217: loose indentation C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27113) : warning 217: loose indentation C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27120) : warning 217: loose indentation C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27125) : warning 217: loose indentation C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27126) : warning 217: loose indentation C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27131) : warning 217: loose indentation C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27132) : warning 217: loose indentation C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27137) : warning 217: loose indentation C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27138) : warning 217: loose indentation C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27143) : warning 217: loose indentation C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27144) : warning 217: loose indentation C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27148) : warning 217: loose indentation C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27149) : warning 217: loose indentation C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27150) : warning 217: loose indentation C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27151) : warning 213: tag mismatch C:\Users\админ\Desktop\Sky World RolePlay\SkyWorldRp.pwn(27153) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
16 Warnings.
Luntik228
|
|
|
|