Jump to content

mitza505

Membru
  • Posts

    107
  • Joined

  • Last visited

    Never

Everything posted by mitza505

  1. vezi ca se produce un BUG enorm:> bn vil zic si voi!(se produce doar cand ai misiunea pentru ca : nu poti avea doua Checkpointuri deodate pe mapa:) folositi asta !adk punetio inainte de SendPlayerCheckpoint [pawn]if(PlayerOnMission[playerid] > 0) { SendClientMessage(playerid, COLOR_GREY, " Nu poti folosi aceasta comanda avand Missiunea"); return 1; }[/pawn]
  2. salut am ai eu un takezone gangwar .. numai ca nu se pun anumite killere. de ex a fst "war" intre ballas si GST si killerele de la gst sau pus iar de la ballas nu . sau invers. akm nsh ce cod sa dau casa titi varog sa imi zicieti si am sa postezi codu ms anticipat :D
  3. 10/10!! numai ca nu merge /enter .. dp ce dau /enter nu intra nicaieri dc?
  4. ala a lui im_back hy.. [pawn] //===========================Section: Includes================================== #include <a_samp> #include <utils> //===========================Section: Definations=============================== #define COLOR_GRAD1 0xB4B5B7FF #define COLOR_GRAD2 0xBFC0C2FF #define COLOR_GRAD3 0xCBCCCEFF #define COLOR_GRAD4 0xD8D8D8FF #define COLOR_GRAD5 0xE3E3E3FF #define COLOR_GRAD6 0xF0F0F0FF #define COLOR_GREEN 0x33AA33AA #define COLOR_GREY 0xAFAFAFAA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_YELLOW2 0xF5DEB3AA #define COLOR_BLUE 0x2641FEAA #pragma tabsize 0 //===========================Section: Forwards================================== forward split(const strsrc[], strdest[][], delimiter); forward LoadCar(); forward SaveCarCoords(); forward OnPropUpdate(); forward IsAnOwnableCar(vehicleid); forward CarKeys(playerid); forward SavePlayerData(playerid); forward ini_GetKey( line[] ); forward ini_GetValue( line[] ); forward OnPlayerKeyStateChange(playerid, newkeys, oldkeys); new carsonserver = 293; new vehName[][] = { "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic", "Sanchez", "Sparrow", "Patriot", "ATV", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking", "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt", "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune", "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Jeep", "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club", "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car LSPD", "Police Car SFPD", "Police Car LVPD", "Police Ranger", "Picador", "S.W.A.T", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville", "Tiller", "Utility Trailer" }; //===========================Section: Variables================================= enum pInfo { pPcarkey, pPcarkey2, pPcarkey3, } new PlayerInfo[256][pInfo]; enum cInfo { cModel, Float:cLocationx, Float:cLocationy, Float:cLocationz, Float:cAngle, cColorOne, cColorTwo, cOwner[MAX_PLAYER_NAME], cDescription[12], cLicense[14], cRegistration, cOwned, cLock, }; new CarInfo[1000][cInfo]; //===========================Section: strtok & split============================ 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; } public split(const strsrc[], strdest[][], delimiter) { new i, li; new aNum; new len; while(i <= strlen(strsrc)){ if(strsrc==delimiter || i==strlen(strsrc)){ len = strmid(strdest[aNum], strsrc, li, i, 128); strdest[aNum][len] = 0; li = i+1; aNum++; } i++; } return 1; } //===========================Section: Callbacks & Functions===================== public OnFilterScriptInit() { printf("Filterscript carownership.amx Initiated\n"); LoadCar(); for(new h = carsonserver; h < sizeof(CarInfo); h++) { AddStaticVehicleEx(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000); } return 1; } public OnFilterScriptExit() { return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { new carid = GetPlayerVehicleID(playerid); if ((newkeys & KEY_SECONDARY_ATTACK)) { if(IsAnOwnableCar(carid) && CarInfo[carid][cOwned] == 0) { TogglePlayerControllable(playerid, 1); RemovePlayerFromVehicle(playerid); } } return 1; } public SavePlayerData(playerid) { if(IsPlayerConnected(playerid)) { new string3[32]; new playername3[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername3, sizeof(playername3)); format(string3, sizeof(string3), "carkeys/%s.ini", playername3); new File: hFile = fopen(string3, io_write); if (hFile) { new var[32]; format(var, 32, "CarKey=%d\n",PlayerInfo[playerid][pPcarkey]);fwrite(hFile, var); format(var, 32, "CarKey2=%d\n",PlayerInfo[playerid][pPcarkey2]);fwrite(hFile, var); format(var, 32, "CarKey3=%d\n",PlayerInfo[playerid][pPcarkey3]);fwrite(hFile, var); fclose(hFile); } } return 1; } public CarKeys(playerid) { new string2[64]; new playername2[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername2, sizeof(playername2)); format(string2, sizeof(string2), "carkeys/%s.ini", playername2); new File: UserFile = fopen(string2, io_read); if ( UserFile ) { new key[ 256 ] , val[ 256 ]; new Data[ 256 ]; while ( fread( UserFile , Data , sizeof( Data ) ) ) { key = ini_GetKey( Data ); if( strcmp( key , "CarKey" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey] = strval( val ); } if( strcmp( key , "CarKey2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey2] = strval( val ); } if( strcmp( key , "CarKey3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey3] = strval( val ); } } fclose(UserFile); SendClientMessage(playerid, COLOR_WHITE,"Car Keys Loaded!!!"); } return 1; } public OnPropUpdate() { new idx; new File: file2; idx = carsonserver; while (idx < sizeof(CarInfo)) { new coordsstring[256]; format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d,%s,%s,%s,%d,%d\n", CarInfo[idx][cModel], CarInfo[idx][cLocationx], CarInfo[idx][cLocationy], CarInfo[idx][cLocationz], CarInfo[idx][cAngle], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo], CarInfo[idx][cOwner], CarInfo[idx][cDescription], CarInfo[idx][cLicense], CarInfo[idx][cOwned], CarInfo[idx][cLock]); if(idx == carsonserver) { file2 = fopen("cars.cfg", io_write); } else { file2 = fopen("cars.cfg", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } return 1; } public IsAnOwnableCar(vehicleid) { if(vehicleid >= carsonserver && vehicleid <= 1000) { return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(IsAnOwnableCar(vehicleid) && CarInfo[vehicleid][cLock] == 1 && CarInfo[vehicleid][cOwned] == 1) { if(IsPlayerAdmin(playerid)) { } else { new Float:cx, Float:cy, Float:cz; GetPlayerPos(playerid, cx, cy, cz); SetPlayerPos(playerid, cx, cy, cz); } } return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnPlayerSpawn(playerid) { CarKeys(playerid); return 1; } public OnPlayerConnect(playerid) { PlayerInfo[playerid][pPcarkey] = -1; PlayerInfo[playerid][pPcarkey2] = -1; PlayerInfo[playerid][pPcarkey3] = -1; for(new h = carsonserver; h < sizeof(CarInfo); h++) { SetVehicleParamsForPlayer(h,playerid,0,CarInfo[h][cLock]); } return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { new idx; new string[256]; new cmd[256]; new tmp[256]; new sendername[MAX_PLAYER_NAME]; new playername[MAX_PLAYER_NAME]; new giveplayerid; new idcar = GetPlayerVehicleID(playerid); cmd = strtok(cmdtext, idx); new vehid; vehid = GetPlayerVehicleID(playerid); if (strcmp(cmd, "/mycars", true) == 0) { if(IsPlayerConnected(playerid)) { new carkey = PlayerInfo[playerid][pPcarkey]; new carkey2 = PlayerInfo[playerid][pPcarkey2]; new carkey3 = PlayerInfo[playerid][pPcarkey3]; if (PlayerInfo[playerid][pPcarkey] != -1) { format(string, sizeof(string), "1| VehModel:[%s] VehValue:[%d] VehColor1:[%d] VehColor2:[%d] VehLocked:[%d]", CarInfo[carkey][cDescription], CarInfo[carkey][cColorOne], CarInfo[carkey][cColorTwo], CarInfo[carkey][cLock]); SendClientMessage(playerid, COLOR_GRAD5,string); } if (PlayerInfo[playerid][pPcarkey2] != -1) { format(string, sizeof(string), "2| VehModel:[%s] VehValue:[%d] VehColor1:[%d] VehColor2:[%d] VehLocked:[%d]", CarInfo[carkey2][cDescription], CarInfo[carkey2][cColorOne], CarInfo[carkey2][cColorTwo], CarInfo[carkey2][cLock]); SendClientMessage(playerid, COLOR_GRAD5,string); } if (PlayerInfo[playerid][pPcarkey3] != -1) { format(string, sizeof(string), "3| VehModel:[%s] VehValue:[%d] VehColor1:[%d] VehColor2:[%d] VehLocked:[%d]", CarInfo[carkey3][cDescription], CarInfo[carkey3][cColorOne], CarInfo[carkey3][cColorTwo], CarInfo[carkey3][cLock]); SendClientMessage(playerid, COLOR_GRAD5,string); } } return 1; } if(strcmp(cmd, "/apark", true) == 0) { if(IsPlayerConnected(playerid)) { new Float:x,Float:y,Float:z; new Float:a; new carid; carid = GetPlayerVehicleID(playerid); GetPlayerName(playerid, playername, sizeof(playername)); GetVehiclePos(carid, x, y, z); GetVehicleZAngle(carid, a); if(IsPlayerAdmin(playerid)) { CarInfo[carid][cLocationx] = x; CarInfo[carid][cLocationy] = y; CarInfo[carid][cLocationz] = z; CarInfo[carid][cAngle] = a; format(string, sizeof(string), "~n~ You have parked your car in this location. ~n~"); GameTextForPlayer(playerid, "You have parked this car in this position. It will respawn here.", 10000, 3); OnPropUpdate(); SavePlayerData(playerid); DestroyVehicle(carid); CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000); return 1; } else { SendClientMessage(playerid, COLOR_GREY, " You are not authorized to use that command !"); return 1; } } return 1; } if(strcmp(cmd, "/adeletecar", true) == 0) { if(IsPlayerAdmin(playerid)) { CarInfo[idcar][cOwned] = 0; CarInfo[idcar][cModel] = 0; CarInfo[idcar][cColorOne] = 0; CarInfo[idcar][cColorTwo] = 0; CarInfo[idcar][cLocationx] = 0; CarInfo[idcar][cLocationy] = 0; CarInfo[idcar][cLocationz] = 0; CarInfo[idcar][cAngle] = 0; CarInfo[idcar][cLock] = 0; strmid(CarInfo[idcar][cOwner], "Dealership", 0, strlen("Dealership"), 999); format(CarInfo[idcar][cDescription], 32, "0"); DestroyVehicle(idcar); OnPropUpdate(); SavePlayerData(playerid); } } if(strcmp(cmd, "/acreateveh", true) == 0) { if(IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "FOLOSESTE: /acreateveh [carid] [color1] [color2]"); return 1; } new car; car = strval(tmp); if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_WHITE, " Id vehiculului nu poate sa fie mai mic de 400 si mai mare de 611 !"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "FOLOSESTE: /acreateveh [carid] [color1] [color2]"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 || color1 > 252) { SendClientMessage(playerid, COLOR_WHITE, " Id culori este de la 0 la 252 !"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "FOLOSESTE: /acreateveh [carid] [color1] [color2]"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_WHITE, " Id culori este de la 0 la 252 !"); return 1; } new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z); new thiscar = CreateVehicle(car,X,Y,Z,1,color1,color2,99999999); CarInfo[thiscar][cOwned] = 0; CarInfo[thiscar][cModel] = car; CarInfo[thiscar][cColorOne] = color1; CarInfo[thiscar][cColorTwo] = color2; CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1; CarInfo[thiscar][cLock] = 0; PutPlayerInVehicle(playerid,thiscar,0); strmid(CarInfo[vehid][cOwner], "Dealership", 0, strlen("Dealership"), 999); format(CarInfo[thiscar][cDescription], 32, "%s",vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]); format(string, sizeof(string), " Masina %d a fost creata cu succes!.", thiscar); SendClientMessage(playerid, COLOR_BLUE, string); } else { SendClientMessage(playerid, COLOR_GRAD1, " Nu esti autorizat sa folosesti aceasta comanda!!!"); return 1; } } if(!strcmp(cmdtext, "/asellcar", true)) { if(IsPlayerConnected(playerid)) { if(IsPlayerAdmin(playerid)) { new Float:x,Float:y,Float:z; new Float:a; CarInfo[vehid][cOwned] = 0; strmid(CarInfo[vehid][cOwner], "Dealership", 0, strlen("Dealership"), 999); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); GameTextForPlayer(playerid, "~w~You have admin sold the vehicle", 10000, 3); GetVehiclePos(vehid, x, y, z); GetVehicleZAngle(vehid, a); CarInfo[vehid][cLocationx] = x; CarInfo[vehid][cLocationy] = y; CarInfo[vehid][cLocationz] = z; CarInfo[vehid][cAngle] = a; RemovePlayerFromVehicle(playerid); TogglePlayerControllable(playerid, 1); OnPropUpdate(); SavePlayerData(playerid); DestroyVehicle(vehid); CreateVehicle(CarInfo[vehid][cModel],CarInfo[vehid][cLocationx],CarInfo[vehid][cLocationy],CarInfo[vehid][cLocationz]+1.0,CarInfo[vehid][cAngle],CarInfo[vehid][cColorOne],CarInfo[vehid][cColorTwo],60000); return 1; } else { SendClientMessage(playerid, COLOR_GREY, " You're not authorized to use that command !"); return 1; } } return 1; } if(strcmp(cmd, "/asetkey", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /asetkey [playerid/PartOfName] [carkey] [amount]"); SendClientMessage(playerid, COLOR_GRAD4, "|1 CarKey |2 CarKey2 |3 CarKey3"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerAdmin(playerid)) { if(giveplayerid != INVALID_PLAYER_ID) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /asetkey [playerid/PartOfName] [carkey] [amount]"); SendClientMessage(playerid, COLOR_GRAD4, "|1 CarKey |2 CarKey2 |3 CarKey3"); return 1; } new stat; stat = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /asetkey [playerid/PartOfName] [carkey] [amount]"); SendClientMessage(playerid, COLOR_GRAD4, "|1 CarKey |2 CarKey2 |3 CarKey3"); return 1; } new amount; amount = strval(tmp); switch (stat) { case 1: { PlayerInfo[giveplayerid][pPcarkey] = amount; format(string, sizeof(string), " The Player Car Key Was Set To %d", amount); SavePlayerData(playerid); } case 2: { PlayerInfo[giveplayerid][pPcarkey2] = amount; format(string, sizeof(string), " The Player Car Key 2 Was Set To %d", amount); SavePlayerData(playerid); } case 3: { PlayerInfo[giveplayerid][pPcarkey3] = amount; format(string, sizeof(string), " The Player Car Key 3 Was Set To %d", amount); SavePlayerData(playerid); } default: { format(string, sizeof(string), " Invalid Car Key Code", amount); } } SendClientMessage(playerid, COLOR_GRAD1, string); } } else { SendClientMessage(playerid, COLOR_GRAD1, " Doar adminii pot folosi aceasta comanda!"); return 1; } } return 1; } if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) { if(IsPlayerConnected(playerid)) { new x_nr[64]; x_nr = strtok(cmdtext, idx); if(!strlen(x_nr)) { SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]"); SendClientMessage(playerid, COLOR_WHITE, "Available names: park, lock(1-3), model, color, locate(1-3), tow(1-3)"); return 1; } if(strcmp(x_nr,"park",true) == 0) { new Float:x,Float:y,Float:z; new Float:a; new carid; new getcarid; if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; } else { return 1; } getcarid = GetPlayerVehicleID(playerid); GetPlayerName(playerid, playername, sizeof(playername)); GetVehiclePos(carid, x, y, z); GetVehicleZAngle(carid, a); if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1) { if(PlayerInfo[playerid][pPcarkey] == -1 && PlayerInfo[playerid][pPcarkey2] == -1 && PlayerInfo[playerid][pPcarkey3] == -1) { SendClientMessage(playerid, COLOR_GREY, "You don't own a car."); return 1; } if(getcarid == carid) { new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires; CarInfo[carid][cLocationx] = x; CarInfo[carid][cLocationy] = y; CarInfo[carid][cLocationz] = z; CarInfo[carid][cAngle] = a; GetVehicleDamageStatus(carid,panels,doors,lights,tires); GetVehicleHealth(carid, CarHP); OldCarHP = CarHP; format(string, sizeof(string), "~n~ You have parked your vehicle in this location. ~n~"); GameTextForPlayer(playerid, "You have parked your vehicle in this position. It will respawn here.", 10000, 3); OnPropUpdate(); SavePlayerData(playerid); DestroyVehicle(carid); CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000); PutPlayerInVehicle(playerid,carid,0); SetVehicleHealth(carid, OldCarHP); UpdateVehicleDamageStatus(carid,panels,doors,lights,tires); TogglePlayerControllable(playerid, 1); return 1; } } } else if(strcmp(x_nr,"buy",true) == 0) { if(IsAnOwnableCar(idcar)) { if(PlayerInfo[playerid][pPcarkey] == -1) { } else if(PlayerInfo[playerid][pPcarkey2] == -1) { } else if(PlayerInfo[playerid][pPcarkey3] == -1) { } else { SendClientMessage(playerid, COLOR_GREY, " Ai deja 3 masini!!"); return 1; } if(CarInfo[idcar][cOwned]==1) { SendClientMessage(playerid, COLOR_GREY, "Someone already owns this car"); return 1; } if(GetPlayerMoney(playerid)) { if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = idcar; } else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = idcar; } else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = idcar; } else { return 1; } CarInfo[idcar][cOwned] = 1; GetPlayerName(playerid, sendername, sizeof(sendername)); strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3); SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!"); TogglePlayerControllable(playerid, 1); OnPropUpdate(); SavePlayerData(playerid); return 1; } else { SendClientMessage(playerid, COLOR_GREY, " You don't have enough cash with you ! "); return 1; } } } else if(strcmp(x_nr,"model",true) == 0) { new carid; new getcarid; if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; } else { return 1; } getcarid = GetPlayerVehicleID(playerid); GetPlayerName(playerid, playername, sizeof(playername)); if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1) { if(PlayerInfo[playerid][pPcarkey] == -1 && PlayerInfo[playerid][pPcarkey2] == -1) { SendClientMessage(playerid, COLOR_GREY, " You don't have a personal car."); return 1; } if(getcarid == carid) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v model [vehicleid]"); return 1; } new model; model = strval(tmp); if(model < 400 && model > 611) { SendClientMessage(playerid, COLOR_GREY, " Wrong model id!"); return 1; } CarInfo[carid][cModel] = model; format(CarInfo[carid][cDescription], 32, "%s",vehName[model-400]); format(string, sizeof(string), " [Veh Info]: {3D9AD4}New vehicle model saved."); SendClientMessage(playerid, COLOR_YELLOW, string); OnPropUpdate(); SavePlayerData(playerid); TogglePlayerControllable(playerid, 1); return 1; } } else SendClientMessage(playerid, COLOR_GREY, " You are not in personal car"); } else if(strcmp(x_nr,"lock1",true) == 0) { new keycar = PlayerInfo[playerid][pPcarkey]; if(keycar != -1) { new locked[256]; locked = strtok(cmdtext, idx); if(CarInfo[keycar][cLock] == 1) { for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { SetVehicleParamsForPlayer(keycar,i,0,0); } } format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 0; OnPropUpdate(); SavePlayerData(playerid); return 1; } else if(CarInfo[keycar][cLock] == 0) { for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { SetVehicleParamsForPlayer(keycar,i,0,1); } } format(string, sizeof(string), "~w~Vehicle~n~~r~Locked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 1; OnPropUpdate(); SavePlayerData(playerid); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 1"); return 1; } } else if(strcmp(x_nr,"lock2",true) == 0) { new keycar = PlayerInfo[playerid][pPcarkey2]; if(keycar != -1) { new locked[256]; locked = strtok(cmdtext, idx); if(CarInfo[keycar][cLock] == 1) { for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { SetVehicleParamsForPlayer(keycar,i,0,0); } } format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 0; OnPropUpdate(); SavePlayerData(playerid); return 1; } else if(CarInfo[keycar][cLock] == 0) { for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { SetVehicleParamsForPlayer(keycar,i,0,1); } } format(string, sizeof(string), "~w~Vehicle~n~~r~Locked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 1; OnPropUpdate(); SavePlayerData(playerid); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 2"); return 1; } } else if(strcmp(x_nr,"lock3",true) == 0) { new keycar = PlayerInfo[playerid][pPcarkey3]; if(keycar != -1) { new locked[256]; locked = strtok(cmdtext, idx); if(CarInfo[keycar][cLock] == 1) { for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { SetVehicleParamsForPlayer(keycar,i,0,0); } } format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 0; OnPropUpdate(); SavePlayerData(playerid); return 1; } else if(CarInfo[keycar][cLock] == 0) { for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { SetVehicleParamsForPlayer(keycar,i,0,1); } } format(string, sizeof(string), "~w~Vehicle~n~~r~Locked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 1; OnPropUpdate(); SavePlayerData(playerid); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 3"); return 1; } } else if(strcmp(x_nr,"color",true) == 0) { if(PlayerInfo[playerid][pPcarkey] == -1 && PlayerInfo[playerid][pPcarkey2] == -1 && PlayerInfo[playerid][pPcarkey3] == -1) { SendClientMessage(playerid, COLOR_GREY," You don't have a vehicle to respray."); return 1; } if(GetPlayerMoney(playerid) < 1000) { SendClientMessage(playerid, COLOR_GREY," You don't have enough money for vehicle respray."); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v color [ColorOneID] [ColorTwoID]"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 && color1 > 252) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v color [ColorOneID] [ColorTwoID]"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 && color2 > 252) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { vehid = PlayerInfo[playerid][pPcarkey3]; } else { return 1; } if(IsPlayerInVehicle(playerid, vehid)) { CarInfo[vehid][cColorOne] = color1; CarInfo[vehid][cColorTwo] = color2; GivePlayerMoney(playerid, -1000); GameTextForPlayer(playerid, "~w~Bill for a Paint Respray~n~~r~-$1000", 5000, 1); ChangeVehicleColor(vehid, color1, color2); OnPropUpdate(); SavePlayerData(playerid); return 1; } else { SendClientMessage(playerid, COLOR_GREY," You are not in your vehicle."); return 1; } } else if(strcmp(x_nr,"locate1",true) == 0) { if(!IsPlayerConnected(playerid)) { return 1; } new Float:x,Float:y,Float:z; new car = PlayerInfo[playerid][pPcarkey]; if(PlayerInfo[playerid][pPcarkey]==-1) { GameTextForPlayer(playerid, "~w~Nu ai o masina pentru a putea fi localizata", 2500, 3); return 1; } SendClientMessage(playerid,COLOR_WHITE,"Locatia masinii a fost gasita."); GetVehiclePos(car, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 6); return 1; } else if(strcmp(x_nr,"locate2",true) == 0) { if(!IsPlayerConnected(playerid)) { return 1; } new Float:x,Float:y,Float:z; new car = PlayerInfo[playerid][pPcarkey2]; if(PlayerInfo[playerid][pPcarkey]==-1) { GameTextForPlayer(playerid, "~w~Nu ai o masina pentru a putea fi localizata", 2500, 3); return 1; } SendClientMessage(playerid,COLOR_WHITE,"Locatia masinii a fost gasita."); GetVehiclePos(car, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 6); return 1; } else if(strcmp(x_nr,"locate3",true) == 0) { if(!IsPlayerConnected(playerid)) { return 1; } new Float:x,Float:y,Float:z; new car = PlayerInfo[playerid][pPcarkey3]; if(PlayerInfo[playerid][pPcarkey]==-1) { GameTextForPlayer(playerid, "~w~Nu ai o masina pentru a putea fi localizata", 2500, 3); return 1; } SendClientMessage(playerid,COLOR_WHITE,"Locatia masinii a fost gasita."); GetVehiclePos(car, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 6); return 1; } else if(strcmp(x_nr,"tow1",true) == 0) { if(IsPlayerConnected(playerid)) { new car = PlayerInfo[playerid][pPcarkey]; GetPlayerName(playerid, playername, sizeof(playername)); if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey]][cOwner], true) == 0) { GameTextForPlayer(playerid, "~w~Masina a fost~n~~g~Tractata cu succes~n~~r~$-1500", 5000, 1); GivePlayerMoney(playerid,-1500); SetVehicleToRespawn(car); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); } else { GameTextForPlayer(playerid, "~w~Nu detii o masina personala.", 5000, 1); } } } else if(strcmp(x_nr,"tow2",true) == 0) { if(IsPlayerConnected(playerid)) { new car = PlayerInfo[playerid][pPcarkey2]; GetPlayerName(playerid, playername, sizeof(playername)); if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey2]][cOwner], true) == 0) { GameTextForPlayer(playerid, "~w~Masina a fost~n~~g~Tractata cu succes~n~~r~$-1500", 5000, 1); GivePlayerMoney(playerid,-1500); SetVehicleToRespawn(car); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); } else { GameTextForPlayer(playerid, "~w~Nu detii o masina personala.", 5000, 1); } } } else if(strcmp(x_nr,"tow3",true) == 0) { if(IsPlayerConnected(playerid)) { new car = PlayerInfo[playerid][pPcarkey3]; GetPlayerName(playerid, playername, sizeof(playername)); if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey3]][cOwner], true) == 0) { GameTextForPlayer(playerid, "~w~Masina a fost~n~~g~Tractata cu succes~n~~r~$-1500", 5000, 1); GivePlayerMoney(playerid,-1500); SetVehicleToRespawn(car); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); } else { GameTextForPlayer(playerid, "~w~Nu detii o masina personala.", 5000, 1); } } } else { SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]"); SendClientMessage(playerid, COLOR_WHITE, "Available names: park, lock(1-3), model, color locate(1-3), tow(1-3)"); return 1; } } return 1; } return 0; } public OnPlayerEnterCheckpoint(playerid) { DisablePlayerCheckpoint(playerid); return 1; } /*----------Car Save Functions----------*/ public LoadCar() { new arrCoords[31][64]; new strFromFile2[256]; new File: file = fopen("cars.cfg", io_read); if (file) { new idx = carsonserver; while (idx < sizeof(CarInfo)) { fread(file, strFromFile2); split(strFromFile2, arrCoords, ','); CarInfo[idx][cModel] = strval(arrCoords[0]); CarInfo[idx][cLocationx] = floatstr(arrCoords[1]); CarInfo[idx][cLocationy] = floatstr(arrCoords[2]); CarInfo[idx][cLocationz] = floatstr(arrCoords[3]); CarInfo[idx][cAngle] = floatstr(arrCoords[4]); CarInfo[idx][cColorOne] = strval(arrCoords[5]); CarInfo[idx][cColorTwo] = strval(arrCoords[6]); strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255); strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255); strmid(CarInfo[idx][cLicense], arrCoords[10], 0, strlen(arrCoords[10]), 255); CarInfo[idx][cOwned] = strval(arrCoords[11]); CarInfo[idx][cLock] = strval(arrCoords[12]); idx++; } } return 1; } public SaveCarCoords() { new idx; new File: file2; while (idx < sizeof(CarInfo)) { new coordsstring[256]; format(coordsstring, sizeof(coordsstring), "%d|%f|%f|%f|%f|%d|%d\n", CarInfo[idx][cModel], CarInfo[idx][cLocationx], CarInfo[idx][cLocationy], CarInfo[idx][cLocationz], CarInfo[idx][cAngle], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo]); if(idx == carsonserver) { file2 = fopen("cars.cfg", io_write); } else { file2 = fopen("cars.cfg", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { new string[128]; new vehicle = GetPlayerVehicleID(playerid); new newcar = GetPlayerVehicleID(playerid); if(newstate == PLAYER_STATE_DRIVER) { if(IsAnOwnableCar(newcar)) { if(CarInfo[newcar][cOwned]==0) { TogglePlayerControllable(playerid, 0); format(string,sizeof(string),"/v buy to buy this vehicle",CarInfo[newcar][cDescription]); SendClientMessage(playerid, COLOR_BLUE, string); SendClientMessage(playerid, COLOR_BLUE, "or press Enter to exit this vehicle"); } if(CarInfo[newcar][cOwned]==1) { format(string,sizeof(string),"Vehicle registered to %s",CarInfo[newcar][cOwner]); SendClientMessage(playerid, COLOR_BLUE, string); if(PlayerInfo[playerid][pPcarkey] == vehicle) { } else if(PlayerInfo[playerid][pPcarkey2] == vehicle) { } else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { } else { if(IsPlayerAdmin(playerid)) { SendClientMessage(playerid, COLOR_GREY, " You can drive this car because you are admin"); } else { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_GREY, "You don't have a key of this vehicle"); } } } } } return 1; } stock ini_GetKey( line[] ) { new keyRes[256]; keyRes[0] = 0; if ( strfind( line , "=" , true ) == -1 ) return keyRes; strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) ); return keyRes; } stock ini_GetValue( line[] ) { new valRes[256]; valRes[0]=0; if ( strfind( line , "=" , true ) == -1 ) return valRes; strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) ); return valRes; }[/pawn]
  5. deci dupa restart trebuie sa le cumpar iara cum fac sa rezolv aceasta problema . nici nu stiu ce sa va da u.pls help me in PC merge dar pe host nu
  6. deci dupa restart trebuie sa le cumpar iara cum fac sa rezolv aceasta problema . nici nu stiu ce sa va da u.pls help me in PC merge dar pe host nu
  7. [pawn] if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0) { if(IsPlayerConnected(playerid)) { if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1) { SendClientMessage(playerid, COLOR_GREY, " You are not on Duty!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/su)spect [playerid/PartOfName] [crime discription]"); return 1; } giveplayerid = ReturnUser(tmp); if (gTeam[playerid] == 2 || IsACop(playerid)) { if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if (gTeam[giveplayerid] != 2) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/su)spect [playerid/PartOfName] [crime text]"); return 1; } if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; } else { WantedPoints[giveplayerid]+= 2; } SetPlayerCriminal(giveplayerid,playerid, result); return 1; } else { SendClientMessage(playerid, COLOR_GRAD2, " You can't suspect a Cop !"); } } } else { format(string, sizeof(string), " %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD2, " You are not a Cop / FBI / National Guard !"); } } return 1; }[/pawn] incearca cu asta ,cred ca se va opri automat la 10 . asa e la mn , cand ai trcut de 10 iti da doar msg nu si wanted
  8. cum adk cu o comanda la factiune .. ce factiune?
  9. poi bagi un NPC este si tut.
  10. daca baga asta nu ii mai apar obiectele :|
  11. poi ca sa le scot faci in felu urmator : cauti toate obiectele si le bagi pe http://gtamap.delux-host.com/converter/ unde e ipl file format pui MTA 1.0 Map . in C / program file(sau nsh cum e) dp mta san andreas / server/ mods/deathmatch/resources /->> intri de ex in editor_test si deschizi editor_test (din interioru fisierului) cu notpad .copy tot ce e akl te duci si le convertezi dp stergi tot ce era in fisieru editor_test si adaugi obiectele convertite .. te duci in mta dai open cauti numele etc te duci unde ai mapa ,stergi ce ai de sters dai save . te duci iara pe situ ala . convertezi obiectele cu pawno etc . succes sau folseste acest streamer http://code.google.com/p/samp-streamer-plugin/downloads/list scz dar ma bate romana )
  12. au trecut cred ca vreu 48 de H ....... UPPPPP
  13. mitza505

    host

    da sunt comm care ofera host gratuit . !!! daca e cv dami un P.M si iti zic
  14. :-J ... trebuie pus mereu +1 .. asta am facut deja :-J
  15. eu vreau sa pun asta cand se logheaza cnv . si sa se opreasca mel .,, cand sa terminat MS
  16. uite asta e[pawn]//===========================Section: Includes================================== #include <a_samp> #include <utils> //===========================Section: Definations=============================== #define COLOR_GRAD1 0xB4B5B7FF #define COLOR_GRAD2 0xBFC0C2FF #define COLOR_GRAD3 0xCBCCCEFF #define COLOR_GRAD4 0xD8D8D8FF #define COLOR_GRAD5 0xE3E3E3FF #define COLOR_GRAD6 0xF0F0F0FF #define COLOR_GREEN 0x33AA33AA #define COLOR_GREY 0xAFAFAFAA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_YELLOW2 0xF5DEB3AA #define COLOR_BLUE 0x2641FEAA #define COLOR_RED 0xAA3333AA #define COLOR_PURPLE 0xC2A2DAAA #pragma tabsize 0 //===========================Section: Forwards================================== forward LoadCar(); forward SaveCarCoords(); forward OnPropUpdate(); forward IsAnOwnableCar(vehicleid); forward CarKeys(playerid); forward SavePlayerData(playerid); forward ini_GetKey( line[] ); forward ini_GetValue( line[] ); forward OnPlayerKeyStateChange(playerid, newkeys, oldkeys); new carsonserver = 293; new vehName[][] = { "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic", "Sanchez", "Sparrow", "Patriot", "ATV", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking", "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt", "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune", "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Jeep", "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club", "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car LSPD", "Police Car SFPD", "Police Car LVPD", "Police Ranger", "Picador", "S.W.A.T", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville", "Tiller", "Utility Trailer" }; //===========================Section: Variables================================= enum pInfo { pPcarkey, pPcarkey2, pPcarkey3, } new PlayerInfo[256][pInfo]; enum cInfo { cModel, Float:cLocationx, Float:cLocationy, Float:cLocationz, Float:cAngle, cColorOne, cColorTwo, cOwner[MAX_PLAYER_NAME], cDescription[12], cRegistration, cOwned, cLock, }; new CarInfo[1000][cInfo]; //===========================Section: strtok ============================ 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; } //===========================Section: Callbacks & Functions===================== public OnFilterScriptInit() { printf("Filterscript carownership.amx Initiated\n"); LoadCar(); for(new h = carsonserver; h < sizeof(CarInfo); h++) { AddStaticVehicleEx(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000); } return 1; } public OnFilterScriptExit() { return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { new carid = GetPlayerVehicleID(playerid); if ((newkeys & KEY_SECONDARY_ATTACK)) { if(IsAnOwnableCar(carid) && CarInfo[carid][cOwned] == 0) { TogglePlayerControllable(playerid, 1); RemovePlayerFromVehicle(playerid); } } return 1; } public SavePlayerData(playerid) { if(IsPlayerConnected(playerid)) { new string3[32]; new playername3[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername3, sizeof(playername3)); format(string3, sizeof(string3), "carkeys/%s.ini", playername3); new File: hFile = fopen(string3, io_write); if (hFile) { new var[32]; format(var, 32, "CarKey=%d\n",PlayerInfo[playerid][pPcarkey]);fwrite(hFile, var); format(var, 32, "CarKey2=%d\n",PlayerInfo[playerid][pPcarkey2]);fwrite(hFile, var); format(var, 32, "CarKey3=%d\n",PlayerInfo[playerid][pPcarkey3]);fwrite(hFile, var); fclose(hFile); } } return 1; } public CarKeys(playerid) { new string2[64]; new playername2[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername2, sizeof(playername2)); format(string2, sizeof(string2), "carkeys/%s.ini", playername2); new File: UserFile = fopen(string2, io_read); if ( UserFile ) { new key[ 256 ] , val[ 256 ]; new Data[ 256 ]; while ( fread( UserFile , Data , sizeof( Data ) ) ) { key = ini_GetKey( Data ); if( strcmp( key , "CarKey" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey] = strval( val ); } if( strcmp( key , "CarKey2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey2] = strval( val ); } if( strcmp( key , "CarKey3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey3] = strval( val ); } } fclose(UserFile); SendClientMessage(playerid, COLOR_RED,"Car Keys Loaded by Team BestLife!!!"); } return 1; } public OnPropUpdate() { new idx; new File: file2; idx = carsonserver; while (idx < sizeof(CarInfo)) { new coordsstring[256]; format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d,%s,%s,%d,%d\n", CarInfo[idx][cModel], CarInfo[idx][cLocationx], CarInfo[idx][cLocationy], CarInfo[idx][cLocationz], CarInfo[idx][cAngle], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo], CarInfo[idx][cOwner], CarInfo[idx][cDescription], CarInfo[idx][cOwned], CarInfo[idx][cLock]); if(idx == carsonserver) { file2 = fopen("cars.cfg", io_write); } else { file2 = fopen("cars.cfg", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } return 1; } public IsAnOwnableCar(vehicleid) { if(vehicleid >= carsonserver && vehicleid <= 1000) { return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(IsAnOwnableCar(vehicleid) && CarInfo[vehicleid][cLock] == 1 && CarInfo[vehicleid][cOwned] == 1) { if(IsPlayerAdmin(playerid)) { } else { new Float:cx, Float:cy, Float:cz; GetPlayerPos(playerid, cx, cy, cz); SetPlayerPos(playerid, cx, cy, cz); } } return 1; } public OnPlayerSpawn(playerid) { CarKeys(playerid); return 1; } public OnPlayerConnect(playerid) { PlayerInfo[playerid][pPcarkey] = -1; PlayerInfo[playerid][pPcarkey2] = -1; PlayerInfo[playerid][pPcarkey3] = -1; for(new h = carsonserver; h < sizeof(CarInfo); h++) { SetVehicleParamsForPlayer(h,playerid,0,CarInfo[h][cLock]); } return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { new idx; new string[256]; new cmd[256]; new tmp[256]; new sendername[MAX_PLAYER_NAME]; new playername[MAX_PLAYER_NAME]; new giveplayerid; new idcar = GetPlayerVehicleID(playerid); cmd = strtok(cmdtext, idx); new vehid; vehid = GetPlayerVehicleID(playerid); if (strcmp(cmd, "/mycars", true) == 0) { if(IsPlayerConnected(playerid)) { new carkey = PlayerInfo[playerid][pPcarkey]; new carkey2 = PlayerInfo[playerid][pPcarkey2]; new carkey3 = PlayerInfo[playerid][pPcarkey3]; if (PlayerInfo[playerid][pPcarkey] != -1) { format(string, sizeof(string), "1| VehModel:[%s] VehColor1:[%d] VehColor2:[%d] VehLocked:[%d]", CarInfo[carkey][cDescription], CarInfo[carkey][cColorOne], CarInfo[carkey][cColorTwo], CarInfo[carkey][cLock]); SendClientMessage(playerid, COLOR_GRAD5,string); } if (PlayerInfo[playerid][pPcarkey2] != -1) { format(string, sizeof(string), "2| VehModel:[%s] VehColor1:[%d] VehColor2:[%d] VehLocked:[%d]", CarInfo[carkey2][cDescription], CarInfo[carkey2][cColorOne], CarInfo[carkey2][cColorTwo], CarInfo[carkey2][cLock]); SendClientMessage(playerid, COLOR_GRAD5,string); } if (PlayerInfo[playerid][pPcarkey3] != -1) { format(string, sizeof(string), "3| VehModel:[%s] VehColor1:[%d] VehColor2:[%d] VehLocked:[%d]", CarInfo[carkey3][cDescription], CarInfo[carkey3][cColorOne], CarInfo[carkey3][cColorTwo], CarInfo[carkey3][cLock]); SendClientMessage(playerid, COLOR_GRAD5,string); } } return 1; } if(strcmp(cmd, "/apark", true) == 0) { if(IsPlayerConnected(playerid)) { new Float:x,Float:y,Float:z; new Float:a; new carid; carid = GetPlayerVehicleID(playerid); GetPlayerName(playerid, playername, sizeof(playername)); GetVehiclePos(carid, x, y, z); GetVehicleZAngle(carid, a); if(IsPlayerAdmin(playerid)) { CarInfo[carid][cLocationx] = x; CarInfo[carid][cLocationy] = y; CarInfo[carid][cLocationz] = z; CarInfo[carid][cAngle] = a; format(string, sizeof(string), "~n~ You have parked your car in this location. ~n~"); GameTextForPlayer(playerid, "You have parked this car in this position. It will respawn here.", 10000, 3); OnPropUpdate(); SavePlayerData(playerid); DestroyVehicle(carid); CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000); return 1; } else { SendClientMessage(playerid, COLOR_BLUE, "Nu esti autorizat sa folosesti aceasta comanda!!!"); return 1; } } return 1; } if(strcmp(cmd, "/adeletecar", true) == 0) { if(IsPlayerAdmin(playerid)) { CarInfo[idcar][cOwned] = 0; CarInfo[idcar][cModel] = 0; CarInfo[idcar][cColorOne] = 0; CarInfo[idcar][cColorTwo] = 0; CarInfo[idcar][cLocationx] = 0; CarInfo[idcar][cLocationy] = 0; CarInfo[idcar][cLocationz] = 0; CarInfo[idcar][cAngle] = 0; CarInfo[idcar][cLock] = 0; strmid(CarInfo[idcar][cOwner], "Dealership", 0, strlen("Dealership"), 999); format(CarInfo[idcar][cDescription], 32, "0"); DestroyVehicle(idcar); OnPropUpdate(); SavePlayerData(playerid); } } /* if(strcmp(cmd, "/acarkeys", true) == 0) { if(PlayerInfo[playerid][pPcarkey] == -1 && PlayerInfo[playerid][pPcarkey2] == -1 && PlayerInfo[playerid][pPcarkey3] == -1) { SendClientMessage(playerid, COLOR_GREY, "Nu Esti Owneru Acestei Masini"); return 1; } else { CarKeys(playerid); } }*/ if(strcmp(cmd, "/acreateveh", true) == 0) { if(IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "FOLOSESTE: /acreateveh [carid] [color1] [color2]"); return 1; } new car; car = strval(tmp); if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_WHITE, " Id vehiculului nu poate sa fie mai mic de 400 si mai mare de 611 !"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "FOLOSESTE: /acreateveh [carid] [color1] [color2]"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 || color1 > 252) { SendClientMessage(playerid, COLOR_WHITE, " Id culori este de la 0 la 126 !"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "FOLOSESTE: /acreateveh [carid] [color1] [color2]"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 || color2 > 252) { SendClientMessage(playerid, COLOR_WHITE, " Id culori este de la 0 la 126 !"); return 1; } new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z); new thiscar = CreateVehicle(car,X,Y,Z,1,color1,color2,99999999); CarInfo[thiscar][cOwned] = 0; CarInfo[thiscar][cModel] = car; CarInfo[thiscar][cColorOne] = color1; CarInfo[thiscar][cColorTwo] = color2; CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1; CarInfo[thiscar][cLock] = 0; PutPlayerInVehicle(playerid,thiscar,0); strmid(CarInfo[vehid][cOwner], "Dealership", 0, strlen("Dealership"), 999); format(CarInfo[thiscar][cDescription], 32, "%s",vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]); format(string, sizeof(string), " Masina %d a fost creata cu succes!.", thiscar); SendClientMessage(playerid, COLOR_BLUE, string); } else { SendClientMessage(playerid, COLOR_GRAD1, " Nu esti autorizat sa folosesti aceasta comanda!!!"); return 1; } } if(strcmp(cmd, "/asetkey", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "FOLOSESTE: /asetkey [playerid/PartOfName] [carkey] [amount]"); SendClientMessage(playerid, COLOR_GRAD4, "|1 CarKey |2 CarKey2 |3 CarKey3"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerAdmin(playerid)) { if(giveplayerid != INVALID_PLAYER_ID) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "FOLOSESTE: /asetkey [playerid/PartOfName] [carkey] [amount]"); SendClientMessage(playerid, COLOR_GRAD4, "|1 CarKey |2 CarKey2 |3 CarKey3"); return 1; } new stat; stat = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "FOLOSESTE: /asetkey [playerid/PartOfName] [carkey] [amount]"); SendClientMessage(playerid, COLOR_GRAD4, "|1 CarKey |2 CarKey2 |3 CarKey3"); return 1; } new amount; amount = strval(tmp); switch (stat) { case 1: { PlayerInfo[giveplayerid][pPcarkey] = amount; format(string, sizeof(string), " The Player Car Key Was Set To %d", amount); SavePlayerData(playerid); } case 2: { PlayerInfo[giveplayerid][pPcarkey2] = amount; format(string, sizeof(string), " The Player Car Key 2 Was Set To %d", amount); SavePlayerData(playerid); } case 3: { PlayerInfo[giveplayerid][pPcarkey3] = amount; format(string, sizeof(string), " The Player Car Key 3 Was Set To %d", amount); SavePlayerData(playerid); } default: { format(string, sizeof(string), " Codul Cheii Nu Este Valid", amount); } } SendClientMessage(playerid, COLOR_GRAD1, string); } } else { SendClientMessage(playerid, COLOR_GRAD1, " Doar adminii pot folosi aceasta comanda!"); return 1; } } return 1; } if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) { if(IsPlayerConnected(playerid)) { new x_nr[64]; x_nr = strtok(cmdtext, idx); if(!strlen(x_nr)) { SendClientMessage(playerid, COLOR_RED, "HINT: (/v)ehicle [name]"); SendClientMessage(playerid, COLOR_RED, "Available names: park, lock(1-3), color, locate(1-3), tow(1-3)"); SendClientMessage(playerid, COLOR_BLUE, "Available commands:/mycars Comenzi Admin->(/acreatecar,/adeletecar,/apark,/asetkey,/asellcar,/acarkeys)"); return 1; } if(strcmp(x_nr,"buy",true) == 0) { if(IsAnOwnableCar(idcar)) { if(PlayerInfo[playerid][pPcarkey] == 0) { } else if(PlayerInfo[playerid][pPcarkey2] == 0) { } else if(PlayerInfo[playerid][pPcarkey3] == 0) { } else { SendClientMessage(playerid, COLOR_BLUE, " Ai deja 3 masini!!"); return 1; } if(CarInfo[idcar][cOwned]==1) { SendClientMessage(playerid, COLOR_GREY, "Aceata Masina Este Deja Cumparata"); return 1; } if(GetPlayerMoney(playerid)) { if(PlayerInfo[playerid][pPcarkey] == 0) { PlayerInfo[playerid][pPcarkey] = idcar; } else if(PlayerInfo[playerid][pPcarkey2] == 0) { PlayerInfo[playerid][pPcarkey2] = idcar; } else if(PlayerInfo[playerid][pPcarkey3] == 0) { PlayerInfo[playerid][pPcarkey3] = idcar; } else { return 1; } CarInfo[idcar][cOwned] = 1; GetPlayerName(playerid, sendername, sizeof(sendername)); strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); GameTextForPlayer(playerid, "Bravo,ti-ai cumparat o masina NOUA , foloseste /v", 5000, 3); TogglePlayerControllable(playerid, 1); OnPropUpdate(); SavePlayerData(playerid); return 1; } else { SendClientMessage(playerid, COLOR_GREY, " Nu ai bani pentru a cumpara o masina ! "); return 1; } } } else if(strcmp(x_nr,"park",true) == 0) { new Float:x,Float:y,Float:z; new Float:a; new carid; new getcarid; if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; } else { return 1; } getcarid = GetPlayerVehicleID(playerid); GetPlayerName(playerid, playername, sizeof(playername)); GetVehiclePos(carid, x, y, z); GetVehicleZAngle(carid, a); if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1) { if(PlayerInfo[playerid][pPcarkey] == -1 && PlayerInfo[playerid][pPcarkey2] == -1 && PlayerInfo[playerid][pPcarkey3] == -1) { SendClientMessage(playerid, COLOR_GREY, "Tu Nu Esti Owneru Acestei Masini."); return 1; } if(getcarid == carid) { new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires; CarInfo[carid][cLocationx] = x; CarInfo[carid][cLocationy] = y; CarInfo[carid][cLocationz] = z; CarInfo[carid][cAngle] = a; GetVehicleDamageStatus(carid,panels,doors,lights,tires); GetVehicleHealth(carid, CarHP); OldCarHP = CarHP; format(string, sizeof(string), " You have parked your vehicle in this location."); GameTextForPlayer(playerid, "You have parked your vehicle in this position. It will respawn here.", 10000, 3); OnPropUpdate(); SavePlayerData(playerid); DestroyVehicle(carid); CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000); PutPlayerInVehicle(playerid,carid,0); SetVehicleHealth(carid, OldCarHP); UpdateVehicleDamageStatus(carid,panels,doors,lights,tires); TogglePlayerControllable(playerid, 1); return 1; } } } else if(strcmp(x_nr,"lock1",true) == 0) { new keycar = PlayerInfo[playerid][pPcarkey]; if(keycar != -1) { new locked[256]; locked = strtok(cmdtext, idx); if(CarInfo[keycar][cLock] == 1) { for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { SetVehicleParamsForPlayer(keycar,i,0,0); } } format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 0; OnPropUpdate(); SavePlayerData(playerid); return 1; } else if(CarInfo[keycar][cLock] == 0) { for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { SetVehicleParamsForPlayer(keycar,i,0,1); } } format(string, sizeof(string), "~w~Vehicle~n~~r~Locked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 1; OnPropUpdate(); SavePlayerData(playerid); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " Nu Ai Nici O Masina La Slot 1"); return 1; } } else if(strcmp(x_nr,"lock2",true) == 0) { new keycar = PlayerInfo[playerid][pPcarkey2]; if(keycar != -1) { new locked[256]; locked = strtok(cmdtext, idx); if(CarInfo[keycar][cLock] == 1) { for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { SetVehicleParamsForPlayer(keycar,i,0,0); } } format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 0; OnPropUpdate(); SavePlayerData(playerid); return 1; } else if(CarInfo[keycar][cLock] == 0) { for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { SetVehicleParamsForPlayer(keycar,i,0,1); } } format(string, sizeof(string), "~w~Vehicle~n~~r~Locked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 1; OnPropUpdate(); SavePlayerData(playerid); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " Nu Ai Nici O Masina La Slot 2"); return 1; } } else if(strcmp(x_nr,"lock3",true) == 0) { new keycar = PlayerInfo[playerid][pPcarkey3]; if(keycar != -1) { new locked[256]; locked = strtok(cmdtext, idx); if(CarInfo[keycar][cLock] == 1) { for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { SetVehicleParamsForPlayer(keycar,i,0,0); } } format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 0; OnPropUpdate(); SavePlayerData(playerid); return 1; } else if(CarInfo[keycar][cLock] == 0) { for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { SetVehicleParamsForPlayer(keycar,i,0,1); } } format(string, sizeof(string), "~w~Vehicle~n~~r~Locked"); GameTextForPlayer(playerid, string, 4000, 3); CarInfo[keycar][cLock] = 1; OnPropUpdate(); SavePlayerData(playerid); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " Nu Ai Nici O Masina La Slot 3"); return 1; } } else if(strcmp(x_nr,"color",true) == 0) { if(PlayerInfo[playerid][pPcarkey] == -1 && PlayerInfo[playerid][pPcarkey2] == -1 && PlayerInfo[playerid][pPcarkey3] == -1) { SendClientMessage(playerid, COLOR_GREY," Nu ai o masina pentru a o picta ."); return 1; } if(GetPlayerMoney(playerid) < 1000) { SendClientMessage(playerid, COLOR_GREY," Nu ai bani pentru a picta masina."); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "FOLOSESTE: /v color [ColorOneID] [ColorTwoID]"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 && color1 > 252) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "FOLOSESTE: /v color [ColorOneID] [ColorTwoID]"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 && color2 > 252) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { vehid = PlayerInfo[playerid][pPcarkey3]; } else { return 1; } if(IsPlayerInVehicle(playerid, vehid)) { CarInfo[vehid][cColorOne] = color1; CarInfo[vehid][cColorTwo] = color2; GivePlayerMoney(playerid, -1000); GameTextForPlayer(playerid, "~w~Bill for a Paint Respray~n~~r~-$1000", 5000, 1); ChangeVehicleColor(vehid, color1, color2); OnPropUpdate(); SavePlayerData(playerid); return 1; } else { SendClientMessage(playerid, COLOR_GREY," Nu te afli in masina personala."); return 1; } } else if(strcmp(x_nr,"locate1",true) == 0) { if(!IsPlayerConnected(playerid)) { return 1; } new Float:x,Float:y,Float:z; new car = PlayerInfo[playerid][pPcarkey]; if(PlayerInfo[playerid][pPcarkey]==-1) { GameTextForPlayer(playerid, "~w~Nu ai o masina pentru a putea fi localizata", 2500, 3); return 1; } SendClientMessage(playerid,COLOR_WHITE,"Locatia masinii a fost gasita."); GetVehiclePos(car, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 6); return 1; } else if(strcmp(x_nr,"locate2",true) == 0) { if(!IsPlayerConnected(playerid)) { return 1; } new Float:x,Float:y,Float:z; new car = PlayerInfo[playerid][pPcarkey2]; if(PlayerInfo[playerid][pPcarkey]==-1) { GameTextForPlayer(playerid, "~w~Nu ai o masina pentru a putea fi localizata", 2500, 3); return 1; } SendClientMessage(playerid,COLOR_WHITE,"Locatia masinii a fost gasita."); GetVehiclePos(car, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 6); return 1; } else if(strcmp(x_nr,"locate3",true) == 0) { if(!IsPlayerConnected(playerid)) { return 1; } new Float:x,Float:y,Float:z; new car = PlayerInfo[playerid][pPcarkey3]; if(PlayerInfo[playerid][pPcarkey]==-1) { GameTextForPlayer(playerid, "~w~Nu ai o masina pentru a putea fi localizata", 2500, 3); return 1; } SendClientMessage(playerid,COLOR_WHITE,"Locatia masinii a fost gasita."); GetVehiclePos(car, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 6); return 1; } else if(strcmp(x_nr,"tow1",true) == 0) { if(IsPlayerConnected(playerid)) { new car = PlayerInfo[playerid][pPcarkey]; GetPlayerName(playerid, playername, sizeof(playername)); if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey]][cOwner], true) == 0) { GameTextForPlayer(playerid, "~w~Masina a fost~n~~g~Tractata cu succes~n~~r~$-1500", 5000, 1); GivePlayerMoney(playerid,-1500); SetVehicleToRespawn(car); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); } else { GameTextForPlayer(playerid, "~w~Nu detii o masina personala.", 5000, 1); } } } else if(strcmp(x_nr,"tow2",true) == 0) { if(IsPlayerConnected(playerid)) { new car = PlayerInfo[playerid][pPcarkey2]; GetPlayerName(playerid, playername, sizeof(playername)); if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey2]][cOwner], true) == 0) { GameTextForPlayer(playerid, "~w~Masina a fost~n~~g~Tractata cu succes~n~~r~$-1500", 5000, 1); GivePlayerMoney(playerid,-1500); SetVehicleToRespawn(car); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); } else { GameTextForPlayer(playerid, "~w~Nu detii o masina personala.", 5000, 1); } } } else if(strcmp(x_nr,"tow3",true) == 0) { if(IsPlayerConnected(playerid)) { new car = PlayerInfo[playerid][pPcarkey3]; GetPlayerName(playerid, playername, sizeof(playername)); if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey3]][cOwner], true) == 0) { GameTextForPlayer(playerid, "~w~Masina a fost~n~~g~Tractata cu succes~n~~r~$-1500", 5000, 1); GivePlayerMoney(playerid,-1500); SetVehicleToRespawn(car); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); } else { GameTextForPlayer(playerid, "~w~Nu detii o masina personala.", 5000, 1); } } } else { SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]"); SendClientMessage(playerid, COLOR_WHITE, "Available names: park, lock(1-3), color, locate(1-3), tow(1-3)"); return 1; } } return 1; } return 0; } public OnPlayerEnterCheckpoint(playerid) { DisablePlayerCheckpoint(playerid); return 1; } /*----------Car Save Functions----------*/ public SaveCarCoords() { new idx; new File: file2 = fopen("cars.cfg", io_write); while (idx < sizeof(CarInfo)) { new coordsstring[256]; format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d\n", CarInfo[idx][cModel], CarInfo[idx][cLocationx], CarInfo[idx][cLocationy], CarInfo[idx][cLocationz], CarInfo[idx][cAngle], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo]); if(idx == carsonserver) { file2 = fopen("cars.cfg", io_write); } else { file2 = fopen("cars.cfg", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } return 1; } public LoadCar() { new arrCoords[11][64]; new strFromFile2[256]; new File: file = fopen("cars.cfg", io_read); if (file) { new idx = carsonserver; while (idx < sizeof(CarInfo)) { fread(file, strFromFile2); CarInfo[idx][cModel] = strval(arrCoords[0]); CarInfo[idx][cLocationx] = floatstr(arrCoords[1]); CarInfo[idx][cLocationy] = floatstr(arrCoords[2]); CarInfo[idx][cLocationz] = floatstr(arrCoords[3]); CarInfo[idx][cAngle] = floatstr(arrCoords[4]); CarInfo[idx][cColorOne] = strval(arrCoords[5]); CarInfo[idx][cColorTwo] = strval(arrCoords[6]); strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255); strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255); CarInfo[idx][cOwned] = strval(arrCoords[9]); CarInfo[idx][cLock] = strval(arrCoords[10]); idx++; } } return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { new string[128]; new vehicle = GetPlayerVehicleID(playerid); new newcar = GetPlayerVehicleID(playerid); if(newstate == PLAYER_STATE_DRIVER) { if(IsAnOwnableCar(newcar)) { if(CarInfo[newcar][cOwned]==0) { TogglePlayerControllable(playerid, 0); format(string,sizeof(string),"%s %d /v buy pentru a cumpara masina",CarInfo[newcar][cDescription]); SendClientMessage(playerid, COLOR_BLUE, string); SendClientMessage(playerid, COLOR_BLUE, "sau apasa enter pentru a iesi din masina"); } if(CarInfo[newcar][cOwned]==1) { format(string,sizeof(string),"Vehiculul tau %s",CarInfo[newcar][cOwner]); SendClientMessage(playerid, COLOR_BLUE, string); if(PlayerInfo[playerid][pPcarkey] == vehicle) { } else if(PlayerInfo[playerid][pPcarkey2] == vehicle) { } else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { } else { if(IsPlayerAdmin(playerid)) { SendClientMessage(playerid, COLOR_GREY, "Poti conduce Aceasta masina pentru ca esti admin!"); } else { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_GREY, "Tu nu esti %s"); } } } } } return 1; } stock ini_GetKey( line[] ) { new keyRes[256]; keyRes[0] = 0; if ( strfind( line , "=" , true ) == -1 ) return keyRes; strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) ); return keyRes; } stock ini_GetValue( line[] ) { new valRes[256]; valRes[0]=0; if ( strfind( line , "=" , true ) == -1 ) return valRes; strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) ); return valRes; } [/pawn]
  17. poi am pus la on playerconnect PlayAudioStreamForPlayer(playerid, www.gta-cp.info/christmas.mp3); unde gasesc un site sa uploadez si eo asa www.gta-cp.info/christmas.mp3 adk link direct fara download etc.. errori [pawn]C:\Users\Best-Life\Desktop\77.36.64.53-7777\samp03\gamemodes\BestLife.pwn(2467) : error 017: undefined symbol "www" C:\Users\Best-Life\Desktop\77.36.64.53-7777\samp03\gamemodes\BestLife.pwn(2467) : error 029: invalid expression, assumed zero C:\Users\Best-Life\Desktop\77.36.64.53-7777\samp03\gamemodes\BestLife.pwn(2467) : error 017: undefined symbol "gta" C:\Users\Best-Life\Desktop\77.36.64.53-7777\samp03\gamemodes\BestLife.pwn(2467) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.[/pawn]
  18. am facut fix asa cum a zis el: [pawn]Am descoperit aseara cum sa ramana vehiculele de exemplu eu cream masina si cand dadeam restart la server masina disparea acuma nu mai dispare puteti pune si la comanda de restart SaveCarCoords(); public SaveCarCoords() { new idx; new File: file2 = fopen("cars.cfg", io_write); while (idx < sizeof(CarInfo)) { new coordsstring[256]; format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n", CarInfo[idx][cModel], CarInfo[idx][cLocationx], CarInfo[idx][cLocationy], CarInfo[idx][cLocationz], CarInfo[idx][cAngle], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo], CarInfo[idx][mod1], CarInfo[idx][mod2], CarInfo[idx][mod3], CarInfo[idx][mod4], CarInfo[idx][mod5], CarInfo[idx][mod6], CarInfo[idx][mod7], CarInfo[idx][mod8], CarInfo[idx][mod9], CarInfo[idx][mod10], CarInfo[idx][mod11], CarInfo[idx][mod12], CarInfo[idx][mod13], CarInfo[idx][mod14], CarInfo[idx][mod15], CarInfo[idx][mod16], CarInfo[idx][mod17], CarInfo[idx][paintjob]); if(idx == carsonserver) { file2 = fopen("cars.cfg", io_write); } else { file2 = fopen("cars.cfg", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } return 1; } public LoadCar() { new arrCoords[31][64]; new strFromFile2[256]; new File: file = fopen("cars.cfg", io_read); if (file) { new idx = carsonserver; while (idx < sizeof(CarInfo)) { fread(file, strFromFile2); split(strFromFile2, arrCoords, ','); CarInfo[idx][cModel] = strval(arrCoords[0]); CarInfo[idx][cLocationx] = floatstr(arrCoords[1]); CarInfo[idx][cLocationy] = floatstr(arrCoords[2]); CarInfo[idx][cLocationz] = floatstr(arrCoords[3]); CarInfo[idx][cAngle] = floatstr(arrCoords[4]); CarInfo[idx][cColorOne] = strval(arrCoords[5]); CarInfo[idx][cColorTwo] = strval(arrCoords[6]); strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255); strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255); CarInfo[idx][cValue] = strval(arrCoords[9]); strmid(CarInfo[idx][cLicense], arrCoords[10], 0, strlen(arrCoords[10]), 255); CarInfo[idx][cOwned] = strval(arrCoords[11]); CarInfo[idx][cLock] = strval(arrCoords[12]); CarInfo[idx][mod1] = strval(arrCoords[13]); CarInfo[idx][mod2] = strval(arrCoords[14]); CarInfo[idx][mod3] = strval(arrCoords[15]); CarInfo[idx][mod4] = strval(arrCoords[16]); CarInfo[idx][mod5] = strval(arrCoords[17]); CarInfo[idx][mod6] = strval(arrCoords[18]); CarInfo[idx][mod7] = strval(arrCoords[19]); CarInfo[idx][mod8] = strval(arrCoords[20]); CarInfo[idx][mod9] = strval(arrCoords[21]); CarInfo[idx][mod10] = strval(arrCoords[22]); CarInfo[idx][mod11] = strval(arrCoords[23]); CarInfo[idx][mod12] = strval(arrCoords[24]); CarInfo[idx][mod13] = strval(arrCoords[25]); CarInfo[idx][mod14] = strval(arrCoords[26]); CarInfo[idx][mod15] = strval(arrCoords[27]); CarInfo[idx][mod16] = strval(arrCoords[28]); CarInfo[idx][mod17] = strval(arrCoords[29]); CarInfo[idx][paintjob] = strval(arrCoords[30]); printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]); idx++; } } return 1;[/pawn] dar nimica +ca eu nu am fisieru cars.cfg .. ce fac? ca nu mi se salveaza amsinile dp rR
  19. mitza505

    adimn

    frate nu e de la rcon ca nu intra cu pass de la rcon el da login face asa /register mihaitza.romania si intra cu adminu...de unde ar fi problema? si pluginurile sunt streamer audio si sscanf
  20. mitza505

    adimn

    am descoperit in mare parte cred .. deci . sa zicem ca xx se inregistreaza cu pass samp , da /q si la logare da /register mihaita.romania(care e niku dp care am admin) si ii baga adminu direct tot,cum ar fi pe contu mihaitza.romania .. cum rezolv plsss
  21. mitza505

    adimn

    [pawn]#include <a_samp> #include <core> #include <float> #include <time> #include <file> #include <dini> #include <utils> #include <morphinc> #include <JunkBuster> #include <streamer> #include <a_npc>[/pawn] astea le folosesc eo
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.