but the server when any one join samp-server.exe its off otmatic see please help me to fixing this crush
PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <Streamer>
#include <foreach>
#include <YSI\y_ini>
CMD:buycar(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 2, 2037.3206,1342.9086,10.8203)) return SendClientMessage(playerid, -1, "Nu esti langa Dealershipul Grotti.");
{
ShowPlayerDialog(playerid, DIALOG_DSHIP, DIALOG_STYLE_LIST, "{42C2F5}Alege o categorie", "Bikes\nNormal Vehicle\nOff-Road Vehicles\nSport Vehicles\nLowriders\nTrucks", "Alege", "Anuleaza");
}
return 1;
}
if(dialogid == DIALOG_DSHIP) // Dealership main
{
if(response)
{
switch(listitem)
{
case 0: ShowPlayerDialog(playerid, DIALOG_DSHIP1, DIALOG_STYLE_LIST, "{42C2F5}Bikes", "BMX (25k)\nMountain (15k)\nFaggio (150k)\nFreeway (350k)\nSanchez (50k)\nQuad (50k)\nPCJ-600 (250k)\nFCR-900 (300k)\nNGR-500 (1,5m)\nWayfarer (200k)", "Alege", "Anuleaza");
case 1: ShowPlayerDialog(playerid, DIALOG_DSHIP2, DIALOG_STYLE_LIST, "{42C2F5}Normal Vehicles", "Comet (600k)\nFeltzer (500k)\nStallion (350k)\nWindsor (350k)\nSentinel (500k)\nManana (250k)\nElegy (800k)", "Choose", "Cancel");
case 2: ShowPlayerDialog(playerid, DIALOG_DSHIP3, DIALOG_STYLE_LIST, "{42C2F5}Off-Road Vehicles", "Huntley (600k)\nLandstalker (450k)\nSandking (800k)\nCaddy (250k)", "Choose", "Cancel");
case 3: ShowPlayerDialog(playerid, DIALOG_DSHIP4, DIALOG_STYLE_LIST, "{42C2F5}Sport Vehicles", "Sultan (800k)\nBanshee (950k)\nBuffalo (1m)\nBullet (2m)\nCheetah (1m)\nJester (800k)\nTurismo (1,8m)\nSabre (650k)\nInfernus (2m)", "Alege", "Anuleaza");
case 4: ShowPlayerDialog(playerid, DIALOG_DSHIP5, DIALOG_STYLE_LIST, "{42C2F5}Lowriders", "Blade (300k)\nBroadway (200k)\nRemington (500k)\nSavanna (150k)\nSkamvan (300k)\nTornado (200k)\nVoodo (200k)", "Alege", "Anuleaza");
case 5: ShowPlayerDialog(playerid, DIALOG_DSHIP6, DIALOG_STYLE_LIST, "{42C2F5}Trucks", "Linerunner (1m)\nRoadTrain(1.3m)\nTanker (1m)\nFlatbed (800k)\nYankee (500k)\nMule (600k)", "Alege", "Anuleaza");
}
}
}
else if(dialogid == DIALOG_DSHIP1) // Bikes
{
new string[128], price, Giveplayerid, modelid;
if(response)
{
switch(listitem)
{
case 0: {modelid = 481; price = 25000;} // BMX
case 1: {modelid = 510; price = 15000;} // Mountain
case 2: {modelid = 462; price = 150000;} // FAGGIO
case 3: {modelid = 463; price = 350000;} // FREEWAY
case 4: {modelid = 468; price = 50000;} // SANCHEZ
case 5: {modelid = 471; price = 50000;} // QUAD
case 6: {modelid = 461; price = 250000;} // PCJ-600
case 7: {modelid = 521; price = 300000;} // FCR-900
case 8: {modelid = 522; price = 1500000;} // NGR-500
case 9: {modelid = 586; price = 200000;} // Wayfarer
}
new playervehicleid = GetPlayerFreeVehicleId(Giveplayerid);
if(GetPVarInt(playerid, "Cash") < price) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to buy this car.");
GivePlayerCash(playerid, -price);
format(string, sizeof(string), "Va multumim ca ati cumparat de la Grotti Dealership.");
SendClientMessage(playerid, COLOR_YELLOW, string);
CreatePlayerVehicle(Giveplayerid, playervehicleid, modelid, 532.3726,-1287.4926,17.2422,272.3125,0,0,32000);
SetVehicleParamsEx(PlayerInfo[playerid][pVehicles], 0, 0, 0, 1, 0, 0, 0);
GetVehiclePos(PlayerInfo[playerid][pVehicles], PlayerInfo[playerid][pvPosX], PlayerInfo[playerid][pvPosY], PlayerInfo[playerid][pvPosZ]);
GetVehicleZAngle(PlayerInfo[playerid][pVehicles], PlayerInfo[playerid][pvPosAngle]);
}
}
else if(dialogid == DIALOG_DSHIP2) // Normal Vehicles
{
new string[128], price, Giveplayerid, modelid;
if(response)
{
switch(listitem)
{
case 0: {modelid = 480; price = 600000;} // Comet
case 1: {modelid = 533; price = 500000;} // Feltzer
case 2: {modelid = 439; price = 350000;} // Stallion
case 3: {modelid = 555; price = 350000;} // Windsor
case 4: {modelid = 405; price = 500000;} // Sentinel
case 5: {modelid = 410; price = 250000;} // Manana
case 6: {modelid = 562; price = 800000;} // Elegy
}
new playervehicleid = GetPlayerFreeVehicleId(Giveplayerid);
if(GetPVarInt(playerid, "Cash") < price) return SendClientMessage(playerid, -1, "You don't have enough money to buy this car.");
GivePlayerCash(playerid, -price);
format(string, sizeof(string), "Va multumim ca ati cumparat de la Grotti Dealership.");
SendClientMessage(playerid, COLOR_YELLOW, string);
CreatePlayerVehicle(Giveplayerid, playervehicleid, modelid, 532.3726,-1287.4926,17.2422,272.3125,0,0,32000);
SetVehicleParamsEx(PlayerInfo[playerid][pVehicles], 0, 0, 0, 1, 0, 0, 0);
GetVehiclePos(PlayerInfo[playerid][pVehicles], PlayerInfo[playerid][pvPosX], PlayerInfo[playerid][pvPosY], PlayerInfo[playerid][pvPosZ]);
GetVehicleZAngle(PlayerInfo[playerid][pVehicles], PlayerInfo[playerid][pvPosAngle]);
}
}