Server cloeses if i use this command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Server cloeses if i use this command (
/showthread.php?tid=175472)
Server cloeses if i use this command -
Marshall_Banks - 10.09.2010
when i use this command to try to buy a car the samp server closes down
Код:
if(strcmp(cmd, "/buythiscar", true) == 0)
{
new car = 184;
new model = GetVehicleModel(idcar);
if(IsADealerShipVehicle(idcar))
{
if(PlayerInfo[playerid][pPcarkey] == 999 || PlayerInfo[playerid][pPcarkey] == 999) { }
else return SendClientMessage(playerid, COLOR_GREY,"* You already own a cars!");
if(GetPlayerMoney(playerid) >= GetVehiclePrice(idcar))
{
if(PlayerInfo[playerid][pCarLic] == 1)
{
for(new h = 184; h < sizeof(CarInfo); h++)
{
if(CarInfo[h][cOwned] == 1)
{
car = h + 1;
}
}
if(PlayerInfo[playerid][pPcarkey] != 999) { PlayerInfo[playerid][pPcarkey] = car; }
else { PlayerInfo[playerid][pPcarkey] = car; }
CarInfo[car][cOwned] = 1;
strmid(CarInfo[car][cOwner], sendername, 0, strlen(sendername), 999);
GivePlayerMoney(playerid,-GetVehiclePrice(idcar));
CarInfo[car][cModel] = model;
CarInfo[car][cVirWorld] = 0;
GameTextForPlayer(playerid, "~w~Congratulations~n~Don't forget to /carpark it!", 5000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
OnPropUpdate(4);
OnPlayerDataSave(playerid);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* The owner of the dealership didint let you buy a car because you dont have a drivers license!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have enough cash with you ! ");
return 1;
}
return 0;
}
}
Re: Server cloeses if i use this command -
silvan - 11.09.2010
does pawno give you any errors on compile?
Re: Server cloeses if i use this command -
silvan - 11.09.2010
also check the " OnPropUpdate(); " function. also sry for double post.
Re: Server cloeses if i use this command -
Vince - 11.09.2010
Probably an out-of-bounds error. What's the size of 'CarInfo'?