Код:
/*==============================================================================
Do not remove credits by SergioCosta
==============================================================================*/
#include <a_samp>
#define COLOR_ROJO 0xFF0000AA
new SpawnearAuto[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if (!strcmp(cmdtext, "/CarT", true))
{
ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, "{D5FF00}Select You Car By{FFFFFF}|| {00B3FF}SERVER", "{FF0000}Elegy {FFFFFF}Tuning\n{0000FF}Flash {FFFFFF}Tuning\n{00FFFF}Sultan {FFFFFF}Tuning\n{008000}Jester {FFFFFF}Tuning\n{00FFD0}Phoenix {FFFFFF}Tuning\n{99FF00}Cheetah {FFFFFF}Tuning\n{E600FF}Uranus {FFFFFF}Tuning", "X", "=");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
//Menu de Auto truccate
if(dialogid == 5000)
{
if(response)
{
if(listitem == 0)
{
//Elegy
DarVehiculo(playerid, 562);
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid),0);
ChangeVehicleColor(GetPlayerVehicleID(playerid),1,1);
AddVehicleComponent(GetPlayerVehicleID(playerid),1037);
AddVehicleComponent(GetPlayerVehicleID(playerid),1171);
AddVehicleComponent(GetPlayerVehicleID(playerid),1149);
AddVehicleComponent(GetPlayerVehicleID(playerid),1038);
AddVehicleComponent(GetPlayerVehicleID(playerid),1146);
AddVehicleComponent(GetPlayerVehicleID(playerid),1039);
AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
AddVehicleComponent(GetPlayerVehicleID(playerid),1097);
AddVehicleComponent(GetPlayerVehicleID(playerid),1087);
}
if(listitem == 1)
{
//Flash
DarVehiculo(playerid, 565);
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid),2);
ChangeVehicleColor(GetPlayerVehicleID(playerid),1,1);
AddVehicleComponent(GetPlayerVehicleID(playerid),1045);
AddVehicleComponent(GetPlayerVehicleID(playerid),1153);
AddVehicleComponent(GetPlayerVehicleID(playerid),1150);
AddVehicleComponent(GetPlayerVehicleID(playerid),1053);
AddVehicleComponent(GetPlayerVehicleID(playerid),1049);
AddVehicleComponent(GetPlayerVehicleID(playerid),1048);
AddVehicleComponent(GetPlayerVehicleID(playerid),1087);
AddVehicleComponent(GetPlayerVehicleID(playerid),1097);
AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
}
if(listitem == 2)
{
//Sultan
DarVehiculo(playerid, 560);
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid),2);
ChangeVehicleColor(GetPlayerVehicleID(playerid),1,1);
AddVehicleComponent(GetPlayerVehicleID(playerid),1028);
AddVehicleComponent(GetPlayerVehicleID(playerid),1169);
AddVehicleComponent(GetPlayerVehicleID(playerid),1141);
AddVehicleComponent(GetPlayerVehicleID(playerid),1033);
AddVehicleComponent(GetPlayerVehicleID(playerid),1138);
AddVehicleComponent(GetPlayerVehicleID(playerid),1026);
AddVehicleComponent(GetPlayerVehicleID(playerid),1097);
AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
AddVehicleComponent(GetPlayerVehicleID(playerid),1087);
}
if(listitem == 3)
{
//Jester
DarVehiculo(playerid, 559);
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid),2);
ChangeVehicleColor(GetPlayerVehicleID(playerid),1,1);
AddVehicleComponent(GetPlayerVehicleID(playerid),1065);
AddVehicleComponent(GetPlayerVehicleID(playerid),1097);
AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
AddVehicleComponent(GetPlayerVehicleID(playerid),1160);
AddVehicleComponent(GetPlayerVehicleID(playerid),1173);
AddVehicleComponent(GetPlayerVehicleID(playerid),1161);
AddVehicleComponent(GetPlayerVehicleID(playerid),1068);
AddVehicleComponent(GetPlayerVehicleID(playerid),1158);
AddVehicleComponent(GetPlayerVehicleID(playerid),1070);
AddVehicleComponent(GetPlayerVehicleID(playerid),1087);
}
if(listitem == 4)
{
//Phoenix
DarVehiculo(playerid, 603);
ChangeVehicleColor(GetPlayerVehicleID(playerid),3,3);
AddVehicleComponent(GetPlayerVehicleID(playerid),1000);
AddVehicleComponent(GetPlayerVehicleID(playerid),1006);
AddVehicleComponent(GetPlayerVehicleID(playerid),1024);
AddVehicleComponent(GetPlayerVehicleID(playerid),1145);
AddVehicleComponent(GetPlayerVehicleID(playerid),1020);
AddVehicleComponent(GetPlayerVehicleID(playerid),1097);
AddVehicleComponent(GetPlayerVehicleID(playerid),1087);
AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
}
if(listitem == 5)
{
//Cheetah
DarVehiculo(playerid, 415);
ChangeVehicleColor(GetPlayerVehicleID(playerid),1,1);
AddVehicleComponent(GetPlayerVehicleID(playerid),1097);
AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
AddVehicleComponent(GetPlayerVehicleID(playerid),1019);
AddVehicleComponent(GetPlayerVehicleID(playerid),1023);
AddVehicleComponent(GetPlayerVehicleID(playerid),1087);
}
if(listitem == 6)
{
//Uranus
DarVehiculo(playerid, 558);
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid),2);
ChangeVehicleColor(GetPlayerVehicleID(playerid),1,1);
AddVehicleComponent(GetPlayerVehicleID(playerid),1087);
AddVehicleComponent(GetPlayerVehicleID(playerid),1089);
AddVehicleComponent(GetPlayerVehicleID(playerid),1166);
AddVehicleComponent(GetPlayerVehicleID(playerid),1168);
AddVehicleComponent(GetPlayerVehicleID(playerid),1091);
AddVehicleComponent(GetPlayerVehicleID(playerid),1163);
AddVehicleComponent(GetPlayerVehicleID(playerid),1090);
AddVehicleComponent(GetPlayerVehicleID(playerid),1097);
AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
}
}
}
return 1;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
DarVehiculo(playerid, modelid)
{
new Auto, Float:x,Float:y,Float:z,Float:angulo;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
Auto = GetPlayerVehicleID(playerid);
GetVehiclePos(Auto, x, y, z);
GetVehicleZAngle(Auto, angulo);
DestroyVehicle(Auto);
}
else
{
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angulo);
}
if(SpawnearAuto[playerid] != 0) DestroyVehicle(SpawnearAuto[playerid]);
SpawnearAuto[playerid] = CreateVehicle(modelid,x,y,z,angulo,-1,-1,60);
PutPlayerInVehicle(playerid,SpawnearAuto[playerid],0);
LinkVehicleToInterior(Auto, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(Auto, GetPlayerVirtualWorld(playerid));
return 1;
}