09.09.2011, 09:51
Code:
if(strcmp(x_nr,"sell",true) == 0) { if(IsAtDealership(playerid)) { if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { GetPlayerName(playerid, sendername, sizeof(sendername)); new ownvehkey; if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; } else { return 1; } if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0) { new carsellprice = CarInfo[ownvehkey][cValue] / 4 * 3; new Float:x,Float:y,Float:z; new Float:a; CarInfo[ownvehkey][cOwned] = 0; strmid(CarInfo[ownvehkey][cOwner], "Dealership", 0, strlen("Dealership"), 999); GivePlayerMoney(playerid,carsellprice); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); format(string, sizeof(string), "~w~You have sold your car for: ~n~~g~$%d", carsellprice); GameTextForPlayer(playerid, string, 10000, 3); GetVehiclePos(ownvehkey, x, y, z); GetVehicleZAngle(ownvehkey, a); CarInfo[ownvehkey][cLocationx] = x; CarInfo[ownvehkey][cLocationy] = y; CarInfo[ownvehkey][cLocationz] = z; CarInfo[ownvehkey][cAngle] = a; CarInfo[ownvehkey][mod1] = 0; CarInfo[ownvehkey][mod2] = 0; CarInfo[ownvehkey][mod3] = 0; CarInfo[ownvehkey][mod4] = 0; CarInfo[ownvehkey][mod5] = 0; CarInfo[ownvehkey][mod6] = 0; CarInfo[ownvehkey][mod7] = 0; CarInfo[ownvehkey][mod8] = 0; CarInfo[ownvehkey][mod9] = 0; CarInfo[ownvehkey][mod10] = 0; CarInfo[ownvehkey][mod11] = 0; CarInfo[ownvehkey][mod12] = 0; CarInfo[ownvehkey][mod13] = 0; CarInfo[ownvehkey][mod14] = 0; CarInfo[ownvehkey][mod15] = 0; CarInfo[ownvehkey][mod16] = 0; CarInfo[ownvehkey][mod17] = 0; CarInfo[ownvehkey][paintjob] = -1; if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { PlayerInfo[playerid][pPcarkey] = -1; } RemovePlayerFromVehicle(playerid); TogglePlayerControllable(playerid, 1); format(CarInfo[vehid][cLicense], 32 ,"ForSale"); SetVehicleNumberPlate(vehid,CarInfo[vehid][cLicense]); OnPropUpdate(); OnPlayerUpdateEx(playerid); DestroyVehicle(ownvehkey); new thiscar = CreateVehicle(CarInfo[ownvehkey][cModel],CarInfo[ownvehkey][cLocationx],CarInfo[ownvehkey][cLocationy],CarInfo[ownvehkey][cLocationz]+1.0,CarInfo[ownvehkey][cAngle],CarInfo[ownvehkey][cColorOne],CarInfo[ownvehkey][cColorTwo],60000); LoadComponents(thiscar); for(i = 0; i < MAX_VEHICLES; i++) // Looping trough all the vehicles in the server. { new Float:X, Float:Y, Float:Z; GetVehiclePos(i, Float:X, Float:Y, Float;Z); if(Float:X == 1691.1671 && Float:Y == -1069.8132 && Float:Z == 23.6783) { CarAtDealership[i] = true; } else { CarAtDealership[i] = false; } SetVehiclePos(thiscar, x, y, z); } return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " You have to sit at your own car to sell it! "); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You are not at a dealership"); return 1; } }
Code:
D:\SAMP Server R5\gamemodes\new.pwn(20580) : error 017: undefined symbol "i" D:\SAMP Server R5\gamemodes\new.pwn(20580) : warning 205: redundant code: constant expression is zero D:\SAMP Server R5\gamemodes\new.pwn(20580) : error 017: undefined symbol "i" D:\SAMP Server R5\gamemodes\new.pwn(20580) : warning 215: expression has no effect D:\SAMP Server R5\gamemodes\new.pwn(20580) : error 001: expected token: ")", but found ";" D:\SAMP Server R5\gamemodes\new.pwn(20580) : fatal error 107: too many error messages on one line