30.09.2013, 20:11
Hola gente de samp, hoy pensando como hacer un concesionario se me ocurrio pero es demasiado codigo y seria muy lento y muy pesado, nose si alguno sabe hacerlo mas rapido de lo que lo estoy haciendo una forma simple de hacer un concesionario os dejo el codigo:
pawn Код:
#include <a_samp>
#define DIALOG_VEHICLE 5
#define FILTERSCRIPT
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
AddStaticVehicle(602,564.5000000,-1290.4000200,17.1000000,0.0000000,93,27); //Alpha-ID 1
AddStaticVehicle(402,558.2999900,-1290.0999800,17.1000000,0.0000000,105,30); //Buffalo-ID 2
//AddStaticVehicle(429,561.2000100,-1290.4000200,17.0000000,0.0000000,245,245); //Banshee-ID 3
//AddStaticVehicle(541,555.4000200,-1290.0999800,16.9000000,0.0000000,156,156); //Bullet-ID 4
//AddStaticVehicle(415,552.4000200,-1290.1999500,17.0000000,0.0000000,109,108); //Cheetah-ID 5
//AddStaticVehicle(480,549.5000000,-1290.3000500,17.1000000,0.0000000,157,152); //Comet-ID 6
//AddStaticVehicle(587,546.5000000,-1290.3000500,17.0000000,0.0000000,32,32); //Euros-ID 7
//AddStaticVehicle(411,543.5000000,-1290.0000000,16.9000000,0.0000000,164,167); //Infernus-ID 8
//AddStaticVehicle(603,540.2999900,-1289.9000200,17.2000000,0.0000000,88,89); //Phoenix-ID 9
//AddStaticVehicle(506,537.0000000,-1289.6999500,17.0000000,0.0000000,76,117); //Super GT-ID 10
//AddStaticVehicle(451,533.9000200,-1289.6999500,17.0000000,0.0000000,32,32); //Turismo-ID 11
//AddStaticVehicle(477,530.2000100,-1289.8000500,17.1000000,0.0000000,105,30); //ZR-350-ID 12
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == 1) // Player entered a vehicle as a driver
{
ShowPlayerDialog(playerid, DIALOG_VEHICLE, DIALOG_STYLE_MSGBOX, "Alpha", "їQuieres comprate este coche? \nSu precio son 200000$", "Si", "No");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
switch(dialogid)
{
case DIALOG_VEHICLE:
{
if(GetPlayerMoney(playerid) < 200000)
{
SendClientMessage(playerid, 0xFFFFFF, "No tienes suficiente dinero julandron");
RemovePlayerFromVehicle(playerid);
return 1;
}
{
if(GetPlayerMoney(playerid) > 200000)
{
GivePlayerMoney(playerid, -200000);
CreateVehicle(602,557.5,-1266.0,17.24,82.2873,0,1,0);
return RemovePlayerFromVehicle(playerid);
}
}
}
}
}
return RemovePlayerFromVehicle(playerid);
}