Roll |
Дата: Пятница, 08.02.2013, 21:57 | Сообщение # 1
|
Новичок
Сообщений: 11
Статус: Offline
|
Всем привет,вот решил выложить урок как легко и просто купить авто для ДМ сервера. В public OnPlayerCommandText(playerid, cmdtext[]) Код if(!strcmp(cmdtext, "/car", true)) { ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "[Авто] Какое авто вы хотите купить?", "Turismo {33CC00}($30000)\nNRG-500 {33CC00}($30000)\nBullet {33CC00}($30000)\nSultan {33CC00}($30000)\nEuros {33CC00}($30000)\nHuntley {33CC00}($30000)\nElegy {33CC00}($30000)", "Купить", "Отмена"); return 1; } В public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) Код //=================================[Car - Menu]================================= if(dialogid == 2 && response) { switch(listitem) { case 0: { if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0xFFFFFFAA, "[Ошибка] У вас недостаточно денег."); GivePlayerMoney(playerid,-30000); new Float:X,Float:Y,Float:Z,Float:R; GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,R); new id = CreateVehicle(451,X,Y,Z,R,-1,-1,-1); PutPlayerInVehicle(playerid,id,0); LinkVehicleToInterior(id,GetPlayerInterior(playerid)); PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0); } case 1: { if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0xFFFFFFAA, "[Ошибка] У вас недостаточно денег."); GivePlayerMoney(playerid,-30000); new Float:X,Float:Y,Float:Z,Float:R; GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,R); new id = CreateVehicle(522,X,Y,Z,R,-1,-1,-1); PutPlayerInVehicle(playerid,id,0); LinkVehicleToInterior(id,GetPlayerInterior(playerid)); PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0); } case 2: { if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0xFFFFFFAA, "[Ошибка] У вас недостаточно денег."); GivePlayerMoney(playerid,-30000); new Float:X,Float:Y,Float:Z,Float:R; GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,R); new id = CreateVehicle(541,X,Y,Z,R,-1,-1,-1); PutPlayerInVehicle(playerid,id,0); LinkVehicleToInterior(id,GetPlayerInterior(playerid)); PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0); } case 3: { if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0xFFFFFFAA, "[Ошибка] У вас недостаточно денег."); GivePlayerMoney(playerid,-30000); new Float:X,Float:Y,Float:Z,Float:R; GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,R); new id = CreateVehicle(560,X,Y,Z,R,-1,-1,-1); PutPlayerInVehicle(playerid,id,0); LinkVehicleToInterior(id,GetPlayerInterior(playerid)); PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0); } case 4: { if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0xFFFFFFAA, "[Ошибка] У вас недостаточно денег."); GivePlayerMoney(playerid,-30000); new Float:X,Float:Y,Float:Z,Float:R; GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,R); new id = CreateVehicle(587,X,Y,Z,R,-1,-1,-1); PutPlayerInVehicle(playerid,id,0); LinkVehicleToInterior(id,GetPlayerInterior(playerid)); PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0); } case 5: { if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0xFFFFFFAA, "[Ошибка] У вас недостаточно денег."); GivePlayerMoney(playerid,-30000); new Float:X,Float:Y,Float:Z,Float:R; GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,R); new id = CreateVehicle(579,X,Y,Z,R,-1,-1,-1); PutPlayerInVehicle(playerid,id,0); LinkVehicleToInterior(id,GetPlayerInterior(playerid)); PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0); } case 6: { if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0xFFFFFFAA, "[Ошибка] У вас недостаточно денег."); GivePlayerMoney(playerid,-30000); new Float:X,Float:Y,Float:Z,Float:R; GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,R); new id = CreateVehicle(562,X,Y,Z,R,-1,-1,-1); PutPlayerInVehicle(playerid,id,0); LinkVehicleToInterior(id,GetPlayerInterior(playerid)); PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0); } } } //============================================================================== Как то так ))) Кому понравилось или нужно поставте + сик ))) И дальше по аналогии.
Сообщение отредактировал Roll - Пятница, 08.02.2013, 21:57 |
|
|
|