Главный редактор форума: Doc-John | Текущая дата: 30.11.2024, 08:27
  • Страница 1 из 1
  • 1
[Мануал] Магазин игрушек, как на Advance Rp
Оффлайн
Воскресенье, 25.08.2013, 17:05 | Сообщение # 1
Сообщений:
20
0
Здравствуйте ув.пользователи http://isamp.3dn.ru
Сегодня я покажу магазин игрушек как на ( Advance Rp ) и как поставить себе на Server.

Добавляем ко всем New

Цитата
new gamebuy;
new shopgame[2];
new vehgame[MAX_PLAYERS];

В OnPlayerPickUpPickup

Цитата
if(pickupid == shopgame[0])
{
SetPlayerPos(playerid,-2237.2378,135.6198,1035.4141);
SetPlayerFacingAngle(playerid,180);
SetPlayerInterior(playerid,6);
SetPlayerVirtualWorld(playerid, 1);
}
if(pickupid == shopgame[1])
{
SetPlayerPos(playerid,1094.8605,-1274.5646,13.5469);
SetPlayerFacingAngle(playerid,180);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
}
if(pickupid == gamebuy)
{
ShowPlayerDialog(playerid,1456,DIALOG_STYLE_LIST,"Магазин игрушек","1.RC Bandit   {4FFC15}1000${FFFFFF}\n2.RC Baron   {4FFC15}2800${ FFFFFF}\n3.RC Raider   {4FFC15}2500${FFFFFF}\n4.RC Goblin   {4FFC15}2600${FFFFFF}\n5.RC Tiger   {4FFC15}6200${FFFFFF}\n6.RC Cam   {4FFC15}80 0${FFFFFF}","Купить","Отмена");
}

В OnGameModeInit

Цитата
shopgame[0] = CreatePickup(1318,23,1095.0177,-1271.0736,13.5469);
shopgame[1] = CreatePickup(1318,23,-2240.7209,137.0842,1035.4141,1);
gamebuy = CreatePickup(1559,2,-2236.6345,130.3810,1035.4141,1);

В OnDialogResponse

Цитата
if(dialogid == 1456)
{
if(response)
{
if(listitem == 0)
{
SetPlayerPos(playerid,1094.8605,-1274.5646,13.5469);
SetPlayerFacingAngle(playerid,180);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
vehgame [playerid]= CreateVehicle(441, 1094.8605,-1274.5646,13.5469, 0.0, 0, 0, 12000);
PutPlayerInVehicle(playerid, vehgame[playerid], 0);
PlayerInfo [playerid][pCash]-= 1000;
}
if(listitem == 1)
{
SetPlayerPos(playerid,1094.8605,-1274.5646,13.5469);
SetPlayerFacingAngle(playerid,180);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
vehgame [playerid]= CreateVehicle(464, 1094.8605,-1274.5646,13.5469, 0.0, 0, 0, 12000);
PutPlayerInVehicle(playerid, vehgame[playerid], 0);
PlayerInfo [playerid][pCash]-= 2800;
}
if(listitem == 2)
{
SetPlayerPos(playerid,1094.8605,-1274.5646,13.5469);
SetPlayerFacingAngle(playerid,180);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
vehgame [playerid]= CreateVehicle(465, 1094.8605,-1274.5646,13.5469, 0.0, 0, 0, 12000);
PutPlayerInVehicle(playerid, vehgame[playerid], 0);
PlayerInfo [playerid][pCash]-= 2500;
}
if(listitem == 3)
{
SetPlayerPos(playerid,1094.8605,-1274.5646,13.5469);
SetPlayerFacingAngle(playerid,180);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
vehgame [playerid]= CreateVehicle(501, 1094.8605,-1274.5646,13.5469, 0.0, 0, 0, 12000);
PutPlayerInVehicle(playerid, vehgame[playerid], 0);
PlayerInfo [playerid][pCash]-= 2600;
}
if(listitem == 4)
{
SetPlayerPos(playerid,1094.8605,-1274.5646,13.5469);
SetPlayerFacingAngle(playerid,180);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
vehgame [playerid]= CreateVehicle(564, 1094.8605,-1274.5646,13.5469, 0.0, 0, 0, 12000);
PutPlayerInVehicle(playerid, vehgame[playerid], 0);
PlayerInfo [playerid][pCash]-= 6200;
}
if(listitem == 5)
{
SetPlayerPos(playerid,1094.8605,-1274.5646,13.5469);
SetPlayerFacingAngle(playerid,180);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
vehgame [playerid]= CreateVehicle(594, 1094.8605,-1274.5646,13.5469, 0.0, 0, 0, 12000);
PutPlayerInVehicle(playerid, vehgame[playerid], 0);
PlayerInfo [playerid][pCash]-= 800;
}
}
}

В OnPlayerKeyStateChange

Цитата
if(newkeys == 16)
{
if(!IsPlayerConnected(playerid)) return 1;
if(vehgame[playerid]) DestroyVehicle(GetPlayerVehicleID(playerid));
}

Вот так должно быть!

  • Страница 1 из 1
  • 1
Поиск: