 |
|
 |
|
|
|
Последние Файлы GTA 4 |
Последние Файлы GTA-MP |
Реклама |
|
|
|
|
|
Помощь новичкам по GTA скриптингу! #1
| |
| MAK | Дата: Воскресенье, 22.06.2008, 14:49 | Сообщение # 61 |
|
Группа:
Следователи
Сообщений: 2342
Награды: 35
Город: ODESSA
Репутация: 646
Замечания: 0%
Статус: 
| В public OnGameModeInit() UsePlayerPedAnims();
Оплатили голосами за услугу и её не выполняют более чем 4 дня? - Обращайтесь. Вас оскорбили или поступили нечестно? - Обращайтесь. Увидели на форуме спам\флуд, а модератора нет? - Обращайтесь.
Не забывайте указывать в названии сообщения тему, пример: "Перевод за голоса".
|
| |
|
|
| X@nDer | Дата: Понедельник, 23.06.2008, 00:11 | Сообщение # 62 |
|
Новенький
Группа:
Продвинутые
Сообщений: 28
Награды: 1
Город: Ступино
Репутация: 3
Замечания: 20%
Статус: 
| народ, а как сделать чтобы бензин кончался и на заправках можно было заправляться??
|
| |
|
|
| OKStyle™ | Дата: Понедельник, 23.06.2008, 07:13 | Сообщение # 63 |
|
Мастер джэдай
Группа:
I'm V.I.P.
Сообщений: 2444
Награды: 16
Город: Оренбург
Репутация: 1174
Замечания: 40%
Статус: 
| X@nDer, ищи [FS]Fuel System.
Да потому что когда человек делает на заказ он не старается. © kRiSyo Кланяимся нофаму королю анимаций =))))))) © Manusya В MTA - для вас все багоюзеры. Не юзают там +с только EFO и ACF. © SeWeR
|
| |
|
|
| X@nDer | Дата: Понедельник, 23.06.2008, 13:38 | Сообщение # 64 |
|
Новенький
Группа:
Продвинутые
Сообщений: 28
Награды: 1
Город: Ступино
Репутация: 3
Замечания: 20%
Статус: 
| добавил большой ангар, как в заброшеном аэро, внимание вопрос, как сделать чтобы закрывались двери ангара?
|
| |
|
|
| neversmile | Дата: Понедельник, 23.06.2008, 21:16 | Сообщение # 65 |
|
Новенький
Группа:
Пользователи
Сообщений: 27
Награды: 1
Город: Нарва
Репутация: 5
Замечания: 0%
Статус: 
| если ты имееш ввиду ворота то вот: new gate; в самом вверху под public OnGameModeInit() gate = CreateObject(980,-2016.708,388.865,36.945,0.0,0.0,-90.000); под public OnPlayerCommandText(playerid, cmdtext[]) if(strcmp(cmd, "/opengate", true) == 0){ MoveObject(gate,-2016.712,400.537,36.953,5); return 1; } if(strcmp(cmd, "/closegate", true) == 0){ MoveObject(gate,-2016.708,388.865,36.945,5); return 1; } синим - ID ворот (объект) пурпурным - кординаты красным - скорость (1-10) жду плюсик))
Сообщение отредактировал neversmile - Понедельник, 23.06.2008, 21:18 |
| |
|
|
| X@nDer | Дата: Вторник, 24.06.2008, 00:05 | Сообщение # 66 |
|
Новенький
Группа:
Продвинутые
Сообщений: 28
Награды: 1
Город: Ступино
Репутация: 3
Замечания: 20%
Статус: 
| спс
|
| |
|
|
| SeWeR | Дата: Четверг, 26.06.2008, 01:15 | Сообщение # 67 |
|
Мастер джэдай
Группа:
I'm V.I.P.
Сообщений: 3069
Награды: 66
Город: Киев
Замечания: 20%
Статус: 
| Помогите!Научите вписывать скрипты в сам код мода!!Че за чем вставлять,если можно то на примере....как вставить скрипт ЛОТО в мод Бронтозавра?Всем кто поможет + общею!Очень надо!!!
|
| |
|
|
| river | Дата: Четверг, 26.06.2008, 01:34 | Сообщение # 68 |
|
Уверенный в себе
Группа:
Продвинутые
Сообщений: 284
Награды: 1
Город: Москва
Репутация: 37
Замечания: 0%
Статус: 
| Вот на примере лотерии #include <a_samp> Code #define MAX_NO 40 #define LOTTO_PRICE 5000 #define HOW_LONG 120 #define MAX_JACKPOT 6000000 #define MIN_JACKPOT 2000000
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 #define COLOR_GREEN 0x33AA33AA #define COLOR_RED 0xAA3333AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_ORANGE 0xFF8040FF #define PURPLE 0x7E00FDFF #define RED 0xFF0000FF #define GREEN 0x008000FF new Lottery; new LottoEnabled; new string[256]; new playername[MAX_PLAYER_NAME]; new wonlotto[MAX_PLAYERS],donelotto[MAX_PLAYERS]; new jackpot,lotto,lotto2,lotto3,lotto4,lotto5,lotto6; new price = LOTTO_PRICE; new time = HOW_LONG; forward lottery(); public OnPlayerCommandText(playerid, cmdtext[]){ dcmd(lotto,5, cmdtext); dcmd(lottohelp,9, cmdtext); dcmd(lottoon,7, cmdtext); dcmd(lottooff,8, cmdtext); dcmd(lottoprice,10, cmdtext); dcmd(lottery,7, cmdtext); dcmd(winlotto,8, cmdtext); dcmd(lottotime,9, cmdtext); Code public lottery(){ for(new i=0;i<MAX_PLAYERS;i++){ format(string, sizeof(string),"Todays Lotto Numbers: %d, %d, %d, %d, %d, %d!",lotto,lotto2,lotto3,lotto4,lotto5,lotto6); SendClientMessage(i,PURPLE,string); SendClientMessage(i,COLOR_GREEN,"Want to Gamble on the Lotto? Pick a Number! Check Out /lottohelp!"); jackpot = JackpotTotal(); lotto = random(MAX_NO+1); lotto2 = random(MAX_NO+1); lotto3 = random(MAX_NO+1); lotto4 = random(MAX_NO+1); lotto5 = random(MAX_NO+1); lotto6 = random(MAX_NO+1); #if defined STATIC_JACKPOT format(string, sizeof(string),"The Jackpot has been Permantly set to %d!",STATIC_JACKPOT_WINNINGS); SendClientMessage(i,COLOR_GREEN,string); #else format(string, sizeof(string),"Todays Jackpot is $%d!",jackpot); SendClientMessage(i,COLOR_GREEN,string); #endif if (wonlotto[i] ==1){ #if defined STATIC_JACKPOT GetPlayerName(i, playername, MAX_PLAYER_NAME); format(string, sizeof(string),"%s (ID:%d) Has Won the Static Lotto Jackpot of $%d!",playername,i,STATIC_JACKPOT_WINNINGS); SendClientMessageToAll(COLOR_ORANGE,string); GivePlayerMoney(i,STATIC_JACKPOT_WINNINGS[i]); GameTextForPlayer(i,"~g~$$$ !!!! Winner !!!! $$$",5000,5); #else GetPlayerName(i, playername, MAX_PLAYER_NAME); format(string, sizeof(string),"%s (ID:%d) Has Won the Lotto! A Jackpot of $%d",playername,i,jackpot); SendClientMessageToAll(COLOR_ORANGE,string); GameTextForPlayer(i,"~g~$$$ !!!! Winner !!!! $$$",5000,5); #endif //new porn[32]; //format(porn, 32, "%d", jackpot); //new glued = strval(porn); GivePlayerMoney(i,jackpot); donelotto[i] =0; wonlotto[i] =0; return 1; } if(wonlotto[i] == 0 && donelotto[i] == 1){ SendClientMessage(i,COLOR_RED,"Sorry, You Didn't win this time! Please, Try Again!"); donelotto[i] =0; wonlotto[i] =0; return 1; } } return 1; }
dcmd_lotto(playerid, params[]) {
new cmd[256]; new idx; cmd = strtok(params, idx); if(!strlen(params)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /lotto [number]");
if(!LottoEnabled) return SendClientMessage(playerid,RED,"The Lotto is currently Disabled!"); new number = strval(params);
if(number > MAX_NO){ format(string, sizeof(string),"You cannot pick a number higher Than %d!",MAX_NO); SendClientMessage(playerid,COLOR_RED,string); return 1; } if(GetPlayerMoney(playerid) <price ) { format(string, sizeof(string),"You do not Have enough Money. You Require at least $%d",price); SendClientMessage(playerid,COLOR_RED,string); SendClientMessage(playerid,COLOR_RED,"To Purchase a lotto ticket!"); return 1; }
if(donelotto[playerid] ==1) return SendClientMessage(playerid,RED,"You Have already put the lotto on!");
if(number == lotto || number == lotto2 || number == lotto3 || number == lotto4 || number == lotto5 || number == lotto6){
wonlotto[playerid] =1; format(string, sizeof(string),"You have Sucessfully Put the number %d on.",number); SendClientMessage(playerid,GREEN,string); donelotto[playerid] =1; GivePlayerMoney(playerid,-price); }else{ format(string, sizeof(string),"You have Sucessfully Put the number %d on.",number); SendClientMessage(playerid,GREEN,string); donelotto[playerid] =1; GivePlayerMoney(playerid,-price); } return 1; }
dcmd_lottohelp(playerid, params[]){ SendClientMessage(playerid,GREEN,"The Lotto is a Minigame that, if you win,"); SendClientMessage(playerid,GREEN,"Could result in you winning a lot of Money."); SendClientMessage(playerid,GREEN,"The Lotto results come out every so often, and the"); SendClientMessage(playerid,GREEN,"Prizemoney is always different."); format(string, sizeof(string),"To gamble on the Lotto, it costs $%d!",price); SendClientMessage(playerid,COLOR_RED,string); format(string, sizeof(string),"And you must pick a number between 0 and %d.",MAX_NO); SendClientMessage(playerid,COLOR_RED,string); #pragma unused params return 1; }
dcmd_lottoon(playerid, params[]){ if(!IsPlayerAdmin(playerid)) return false; if(LottoEnabled) return SendClientMessage(playerid,RED,"The Lottery is on!"); SendClientMessageToAll(COLOR_ORANGE,"The Lottery has been enabled."); Lottery = SetTimer("lottery",time*1000, 1); SendClientMessage(playerid,GREEN,"You have successfully enabled the Lottery."); LottoEnabled = 1; #pragma unused params return 1; } dcmd_lottooff(playerid, params[]){ if(!IsPlayerAdmin(playerid)) return false; if(!LottoEnabled) return SendClientMessage(playerid,RED,"The Lottery is off!"); SendClientMessageToAll(COLOR_ORANGE,"The Lottery has been Disabled!"); KillTimer(Lottery); SendClientMessage(playerid,GREEN,"You have successfully Disabled the Lottery."); LottoEnabled = 0; #pragma unused params return 1; }
dcmd_lottoprice(playerid, params[]){ if(!IsPlayerAdmin(playerid)) return false; new no = strval(params); if(!strlen(params)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /lottoprice [price]"); if(no == price) return SendClientMessage(playerid,RED,"Tickets are already that Price!"); price = no; format(string,256,"It now costs $%d to purchase a Lotto Ticket.",price); SendClientMessageToAll(COLOR_ORANGE,string); return 1; } dcmd_lottery(playerid, params[]){ if(!IsPlayerAdmin(playerid)) return false; lottery(); SendClientMessage(playerid,GREEN,"You have shown the Lottery."); #pragma unused params return 1; } dcmd_winlotto(playerid, params[]){ if(!strlen(params)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /winlotto [id]"); new endid = strval(params); if(!IsPlayerConnected(endid)) return SendClientMessage(playerid,RED,"Invalid Player ID!"); if(!IsPlayerAdmin(playerid)) return false; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(string,256,"You have forced %s (ID: %d) To Win the Next Lotto Draw!",name,endid); SendClientMessage(playerid,COLOR_GREEN,string); wonlotto[endid] =1; donelotto[endid] =1; return 1; }
dcmd_lottotime(playerid, params[]){
if(!IsPlayerAdmin(playerid)) return false;
new newtime = strval(params);
if(!strlen(params)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /lottotime [seconds]");
if(newtime == time) return SendClientMessage(playerid,RED,"The Lottery already Draws that Often!");
time = newtime;
format(string,256,"The Lotto will now be drawn every %d Seconds!",time);
SendClientMessageToAll(COLOR_ORANGE,string);
KillTimer(Lottery);
Lottery = SetTimer("lottery",time*1000, 1);
return true; }
public OnPlayerConnect(playerid){ donelotto[playerid] =0; wonlotto[playerid] =0; return 1; } Code stock JackpotTotal() { new randnum = random(MAX_JACKPOT-MIN_JACKPOT); return randnum+MIN_JACKPOT; }
strtok(const str1[], &index) { new length = strlen(str1); while ((index < length) && (str1[index] <= ' ')) { index++; }
new offset = index; new result[20]; while ((index < length) && (str1[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = str1[index]; index++; } result[index - offset] = EOS; return result; } Незнаю я бы так вставил =)
|
| |
|
|
| SeWeR | Дата: Четверг, 26.06.2008, 01:41 | Сообщение # 69 |
|
Мастер джэдай
Группа:
I'm V.I.P.
Сообщений: 3069
Награды: 66
Город: Киев
Замечания: 20%
Статус: 
| Ты мя не понял или я тя не понял,вообщем мне надо...все по порядку!Что куда вставлять в код мода,мод будет Бронтозавра!А ты просто мне код скрипта ЛОТО написал!
|
| |
|
|
| JaguaR | Дата: Понедельник, 30.06.2008, 09:22 | Сообщение # 70 |
|
Группа:
I'm V.I.P.
Сообщений: 2838
Награды: 90
Город: Ekaterinburg
Репутация: 867
Замечания: 0%
Статус: 
| Пожалуйста подскажите плз!! как зделать так что когда заходишь в аммо тебя не сажали в тюрьму!! (в PWN не разбираюсь) и ещё не могли бы вы мне помочь научится работать с PWN
|
| |
|
|
| slayer | Дата: Понедельник, 30.06.2008, 12:28 | Сообщение # 71 |
|
Местный
Группа:
I'm V.I.P.
Сообщений: 668
Награды: 12
Город: Tallinn
Репутация: 172
Замечания: 0%
Статус: 
| Shim: В каком моде войти в Оружейку не можешь?
|
| |
|
|
| JaguaR | Дата: Понедельник, 30.06.2008, 15:43 | Сообщение # 72 |
|
Группа:
I'm V.I.P.
Сообщений: 2838
Награды: 90
Город: Ekaterinburg
Репутация: 867
Замечания: 0%
Статус: 
| PEN:LS [ENG-RUS] тут!! Добавлено (30.06.2008, 14:33) --------------------------------------------- а как или где мона научится работать с PWN??? подскажите плз!!!  Добавлено (30.06.2008, 15:43) --------------------------------------------- Что вы так молчите!!! 
|
| |
|
|
| Orange | Дата: Вторник, 01.07.2008, 10:44 | Сообщение # 73 |
|
Уважаемый человек
Группа:
Продвинутые
Сообщений: 945
Награды: 6
Город: San Fierro
Репутация: 101
Замечания: 0%
Статус: 
| Shim, читай Samp Textbook , там все поймешь, также вики на нашем форуме, смотри простые моды и фс, которые идут вместе с сервером, начинай с малого, прибавляй понемножку, делай команды, еще всякие фичи. А то ты сразу за pen взялся, начинай понемногу!
|
| |
|
|
| X@nDer | Дата: Вторник, 01.07.2008, 13:26 | Сообщение # 74 |
|
Новенький
Группа:
Продвинутые
Сообщений: 28
Награды: 1
Город: Ступино
Репутация: 3
Замечания: 20%
Статус: 
| народ, что надо сделать чтоб когда кто то кого то убивает, это отображалось, как обычно справа?
|
| |
|
|
| Orange | Дата: Вторник, 01.07.2008, 13:37 | Сообщение # 75 |
|
Уважаемый человек
Группа:
Продвинутые
Сообщений: 945
Награды: 6
Город: San Fierro
Репутация: 101
Замечания: 0%
Статус: 
| вставь SendDeathMessage(killerid,playerid,reason); в OnPlayerDeath
|
| |
|
|
|
 |
|
 | |
| |
|