04.05.2012, 15:32
pawn Код:
#include <a_samp>
new udyalan;
new string[128];
new Nome[MAX_PLAYER_NAME];
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/tunar",cmdtext,true) == 0)
{
if(!IsPlayerInRangeOfPoint(playerid, 2.0, 1025.8290,-1340.0458,13.7266)) return SendClientMessage(playerid, 0x10FF1BAA," Vocк Nгo esta no Lugar Pra Tunar Seu Carro");
ShowPlayerDialog(playerid,12,DIALOG_STYLE_LIST,"Tunar","PaintJob\nNitro\nRodas\nPintar Carro\nHidraulica\nCarrosTunados\nArumar Veiculo","OK","");
GetPlayerName(playerid, Nome, sizeof(Nome));
format(string, sizeof(string)," %s [ID:%d] Esta Tunando seu Carro Use /tunar",Nome,playerid);
SendClientMessageToAll(0x10FF1BAA,string);
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new vehicle = GetPlayerVehicleID(playerid);
if(dialogid == 12)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid,13,DIALOG_STYLE_LIST,"Paint Jobs","Paint1\nPaint2\nPaint3","OK","");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid,14,DIALOG_STYLE_LIST,"Nitros","Nitro 2\nNitro 5 \nNitro 10","OK","");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid,15,DIALOG_STYLE_LIST,"Rodas","Shadow \nMega \nRimshine \nWires \nClassic \nTwist \nCutter \nSwitch \nGrove \nDollar \nTrance \nAtomic","OK","");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid,16,DIALOG_STYLE_LIST,"Pintar Carro","Branco\nPreto\nAzul\nAzul Fraco\nVerde\nVerde Fraco\nRosa\nMarron","OK","");
}
if(listitem == 4)
{
AddVehicleComponent(vehicle, 1087); // Hidraulica
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Hidraulica no Seu Carro -500");
}
if(listitem == 5)
{
ShowPlayerDialog(playerid,18,DIALOG_STYLE_LIST,"Escolha Seu Carro","Sultan \nUranus \nElegy \nJester \nTornado \nFlash ","OK","");
}
if(listitem == 6)
{
RepairVehicle(GetPlayerVehicleID(playerid));
GivePlayerMoney(playerid, -500);
}
}
return 1;
}
if(dialogid == 14)
{
if(response)
{
if(listitem == 0)
{
AddVehicleComponent(vehicle, 1009); // Nitro 1
GivePlayerMoney(playerid, -300);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Nitro 1 -300");
}
if(listitem == 1)
{
AddVehicleComponent(vehicle, 1008); // Nitro 2
GivePlayerMoney(playerid, -600);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Nitro 2 -600");
}
if(listitem == 2)
{
AddVehicleComponent(vehicle, 1010); // Nitro 3
GivePlayerMoney(playerid, -1000);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Nitro 3 -1000");
}
}
}
if(dialogid == 13)
{
if(response)
{
if(listitem == 0)
{
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), 0);
}
if(listitem == 1)
{
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), 1);
}
if(listitem == 2)
{
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), 2);
}
}
return 1;
}
if(dialogid == 15)
{
if(response)
{
if(listitem == 0)
{
AddVehicleComponent(vehicle, 1073); // Shadow
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Shadow -500");
}
if(listitem == 1)
{
AddVehicleComponent(vehicle, 1074); // Mega
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Mega -500");
}
if(listitem == 2)
{
AddVehicleComponent(vehicle, 1075); // Rimshine
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Rimshine -500");
}
if(listitem == 3)
{
AddVehicleComponent(vehicle, 1076); // Wires
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Wires -500");
}
if(listitem == 4)
{
AddVehicleComponent(vehicle, 1077); // Classic
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Classic -500");
}
if(listitem == 5)
{
AddVehicleComponent(vehicle, 1078); // Twist
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Twist -500");
}
if(listitem == 6)
{
AddVehicleComponent(vehicle, 1079); // Cutter
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Cutter -500");
}
if(listitem == 7)
{
AddVehicleComponent(vehicle, 1080); // Switch
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Switch -500");
}
if(listitem == 8)
{
AddVehicleComponent(vehicle, 1081); // Grove
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Grove -500");
}
if(listitem == 9)
{
AddVehicleComponent(vehicle, 1082); // Import
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Import -500");
}
if(listitem == 10)
{
AddVehicleComponent(vehicle, 1083); // Dollar
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Dollar -500");
}
if(listitem == 11)
{
AddVehicleComponent(vehicle, 1084); // Trance
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Trance -500");
}
if(listitem == 12)
{
AddVehicleComponent(vehicle, 1085); // Atomic
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pois Atomic -500");
}
}
return 1;
}
new vehicleid = GetPlayerVehicleID(playerid);
if(dialogid == 16)
{
if(response)
{
if(listitem == 0)
{
ChangeVehicleColor(vehicleid, 1, 1);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pintou seu Carro de Branco -500");
}
if(listitem == 1)
{
ChangeVehicleColor(vehicleid, 0, 0);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pintou seu Carro de Preto -500");
}
if(listitem == 2)
{
ChangeVehicleColor(vehicleid, 79, 79);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pintou seu Carro de Azul -500");
}
if(listitem == 3)
{
ChangeVehicleColor(vehicleid, 7, 7);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pintou seu Carro de Azul Fraco -500");
}
if(listitem == 4)
{
ChangeVehicleColor(vehicleid, 44, 44);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pintou seu Carro de Verde -500");
}
if(listitem == 5)
{
ChangeVehicleColor(vehicleid, 86, 86);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pintou seu Carro de Verde Fraco -500");
}
if(listitem == 6)
{
ChangeVehicleColor(vehicleid, 126, 126);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pintou seu Carro de Rosa -500");
}
if(listitem == 7)
{
ChangeVehicleColor(vehicleid, 66, 66);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, 0x10FF1BAA,"Vocк Pintou seu Carro de Marron -500");
}
}
return 1;
}
if(dialogid == 1250)
{
if(response)
{
if(listitem == 0)
{
udyalan = CreateVehicle(586,2161.73217773,-1152.82556152,23.57603836,270.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 1)
{
udyalan = CreateVehicle(581,2161.39697266,-1147.91210938,24.07526207,270.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 2)
{
udyalan = CreateVehicle(522,2161.92138672,-1157.94616699,23.50122643,270.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 3)
{
udyalan = CreateVehicle(521,2162.00341797,-1163.12060547,23.47746658,270.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 4)
{
udyalan = CreateVehicle(463,2162.08569336,-1172.70642090,23.48036194,270.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 5)
{
udyalan = CreateVehicle(448,2162.18750000,-1167.87695312,23.47648430,270.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 6)
{
udyalan = CreateVehicle(461,2161.52734375,-1177.82287598,23.47714424,270.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 7)
{
udyalan = CreateVehicle(462,2161.44897461,-1182.11096191,23.47819138,270.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 8)
{
udyalan = CreateVehicle(468,2161.56005859,-1186.96667480,23.47937775,270.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
}
return 1;
}
if(dialogid == 1251)
{
if(response)
{
if(listitem == 0)
{
udyalan = CreateVehicle(451,2148.55541992,-1152.84240723,23.91133118,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 1)
{
udyalan = CreateVehicle(477,2148.58984375,-1157.21093750,23.84609413,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 2)
{
udyalan = CreateVehicle(480,2148.38110352,-1175.64282227,23.82031250,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 3)
{
udyalan = CreateVehicle(535,2148.80932617,-1143.18493652,24.97484779,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 4)
{
udyalan = CreateVehicle(541,2148.63769531,-1148.30468750,24.40734863,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 5)
{
udyalan = CreateVehicle(558,2148.36621094,-1161.46972656,23.82031250,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 6)
{
udyalan = CreateVehicle(559,2149.02734375,-1138.34765625,25.50358200,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 7)
{
udyalan = CreateVehicle(560,2148.39257812,-1166.58496094,23.82031250,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 8)
{
udyalan = CreateVehicle(561,2148.33886719,-1170.99218750,23.82031250,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 9)
{
udyalan = CreateVehicle(562,2148.57836914,-1194.33593750,23.83190155,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 10)
{
udyalan = CreateVehicle(571,2148.60742188,-1180.08984375,23.82031250,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 11)
{
udyalan = CreateVehicle(587,2148.60742188,-1180.08984375,23.82031250,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 12)
{
udyalan = CreateVehicle(602,2148.72436523,-1199.08593750,23.89208984,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 13)
{
udyalan = CreateVehicle(603,2148.83496094,-1189.26574707,23.82031250,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
if(listitem == 14)
{
udyalan = CreateVehicle(402,2148.59448242,-1184.71508789,23.82031250,90.00000000,103,103,100);
PutPlayerInVehicle(playerid, udyalan, 0);
}
}
return 1;
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(vehicleid == udyalan)
{
DestroyVehicle(udyalan);
}
return true;
}
quano vai tunar o carro aparece o tutorial