crazyzee Posted April 4, 2013 Posted April 4, 2013 Am ceva probleme la scriptul de masini personale !1. Cand dau /v park nu se parcheaza masina unde vreau eu 2. /v color nu merge sa schimb culoarea 3. masina vreau sa nu o poata conduce decat proprietaru , daca incearca cineva sa o ia sa il dea jos automat .Aici este scriptul ...[pawn]if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) // By LordMan { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You need to login first ! "); return 1; } if(PlayerInfo[playerid][pCarBan] == 1) { SendClientMessage(playerid, COLOR_GREY, " You'r banned to use /v commands ! "); return 1; } if(PlayerInfo[playerid][pLevel] >= 3 && PlayerInfo[playerid][pConnectTime] >= 36) { 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, color, create"); return 1; } else if(strcmp(x_nr,"park",true) == 0) { if(PlayerInfo[playerid][pCar] == 9999) { SendClientMessage(playerid, COLOR_GREY, "You don't own a car."); return 1; } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new carid = GetPlayerVehicleID(playerid); if(carid == PlayerInfo[playerid][pCar]) { new Float:x,Float:y,Float:z; new Float:a; GetPlayerName(playerid, playername, sizeof(playername)); GetVehiclePos(carid, x, y, z); GetVehicleZAngle(carid, a); CarInfo[carid][cLocationx] = x; CarInfo[carid][cLocationy] = y; CarInfo[carid][cLocationz] = z; CarInfo[carid][cAngle] = a; format(string, sizeof(string), "You have saved your vehicle at the position %f.01, %f.01, %f.01, Remember it, it will respawn here!",x,y,z); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); SaveCar(carid); } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in your car."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in a car."); return 1; } return 1; } else if(strcmp(x_nr,"color",true) == 0) { if(PlayerInfo[playerid][pCar] == 9999) { SendClientMessage(playerid, COLOR_GREY,"* You don't have a vehicle to respray."); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 && color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 && color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } if(GetPlayerMoney(playerid) < 50000) { SendClientMessage(playerid, COLOR_GREY, " Nu ai suficienti bani!"); return 1; } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new vehid = GetPlayerVehicleID(playerid); if(CarInfo[vehid][cID] == PlayerInfo[playerid][pCar]) { CarInfo[vehid][cColorOne] = color1; CarInfo[vehid][cColorTwo] = color2; ChangeVehicleColor(vehid, color1, color2); GivePlayerMoney(playerid, -50000); SendClientMessage(playerid, COLOR_WHITE, "Ti-ai modificat culoarea!"); SaveCar(vehid); } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in your car."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in a car."); return 1; } return 1; } else if(strcmp(x_nr,"create",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 && color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 && color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } new car = 0; if(PlayerInfo[playerid][pCar] == 9999) { } else return SendClientMessage(playerid, COLOR_GREY,"* You already own a car!"); for(new h = 760; h < sizeof(CarInfo); h++) { if(CarInfo[h][cOwned] == 0) { car = h; h = 1300; } } new Float:AX,Float:AY,Float:AZ,Float:Angle; GetPlayerPos(playerid, AX,AY,AZ); GetPlayerFacingAngle(playerid, Angle); format(string, 128, "cars/%d.ini", car); new playername2[MAX_PLAYER_NAME]; playername2 = PlayerName(playerid); if(dini_Exists(string)) { CarInfo[car][cID] = car; CarInfo[car][cOwned] = 1; strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999); CarInfo[car][cLocationx] = AX; CarInfo[car][cLocationy] = AY; CarInfo[car][cLocationz] = AZ; CarInfo[car][cAngle] = Angle; CarInfo[car][cModel] = 522; CarInfo[car][cColorOne] = color1; CarInfo[car][cColorTwo] = color2; SaveCar(car); } else { dini_Create(string); CarInfo[car][cID] = car; CarInfo[car][cOwned] = 1; strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999); CarInfo[car][cLocationx] = AX; CarInfo[car][cLocationy] = AY; CarInfo[car][cLocationz] = AZ; CarInfo[car][cAngle] = Angle; CarInfo[car][cModel] = 522; CarInfo[car][cColorOne] = color1; CarInfo[car][cColorTwo] = color2; SaveCar(car); } PlayerInfo[playerid][pCar] = car; ownedcar[car] = CreateVehicle(522,CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],CarInfo[car][cAngle],CarInfo[car][cColorOne],CarInfo[car][cColorTwo],300); SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!"); SendClientMessage(playerid, COLOR_GRAD2, "Type /vehicle to view the vehicle manual!"); GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget where you placed you'r new ~b~car!", 5000, 3); } else { SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]"); SendClientMessage(playerid, COLOR_WHITE, "Available names: color, park, create"); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD2, "Trebuie sa ai level 3 si 36 ore pe server!"); return 1; } } return 1; }[/pawn] RPG.VIBEPLAY.RORecomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!
D@rksone Posted April 4, 2013 Posted April 4, 2013 Comanda: /vehicleif(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) by Darksone { if(IsPlayerConnected(playerid)) { new x_nr[64]; x_nr = strtok(cmdtext, idx); if(!strlen(x_nr)) { SendClientMessage(playerid, COLOR_WHITE, "____________[Personal Vehicle Help]____________"); SendClientMessage(playerid, COLOR_WHITE, "** {1AFF00}/v {09DFF7}[name]"); SendClientMessage(playerid, COLOR_WHITE, "**park, color, tow(1-3), fix(1-3), locate(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 = GetPlayerVehicleID(playerid); 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; } 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; OnCarUpdate(); 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); format(TextCar, sizeof(TextCar), "{EE1111}Owner: {0099FF}• %s •", CarInfo[carid][cOwner]); Update3DTextLabelText(TextUpCar[carid], 0x33AAFFFF, TextCar); LoadComponents(carid); SendClientMessage(playerid, COLOR_BLUE, "* Noua pozitie a fost salvata!"); SetVehicleHealth(carid, OldCarHP); UpdateVehicleDamageStatus(carid, panels, doors, lights, tires); 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) >= CarInfo[idcar][cValue]) { 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); GivePlayerMoney(playerid,-CarInfo[idcar][cValue]); Delete3DTextLabel(TextUpCar[idcar]); format(TextCar, sizeof(TextCar), "{EE1111}Owner: {0099FF}• %s •", CarInfo[idcar][cOwner]); TextUpCar[idcar] = Create3DTextLabel(TextCar, 0x33AAFFFF, 0.0, 0.0, 0.0, 25, 0, 1); Attach3DTextLabelToVehicle(TextUpCar[idcar], idcar, 0.0, 0.0, 0.1); OnCarUpdate(); SavePlayerData(playerid); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park !", 5000, 3); TogglePlayerControllable(playerid, 1); return 1; } else { SendClientMessage(playerid, COLOR_GREY, " You don't have enough cash with you ! "); 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 > 126) { 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 > 126) { 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)) { new Float:CarHP, Float:OldCarHP; new panels, doors, lights, tires; GetVehicleDamageStatus(vehid, panels, doors, lights, tires); GetVehicleHealth(vehid, CarHP); OldCarHP = CarHP; CarInfo[vehid][cColorOne] = color1; CarInfo[vehid][cColorTwo] = color2; GivePlayerMoney(playerid, -1000); GameTextForPlayer(playerid, "~w~Masina Personala~n~~g~Revopsita cu succes~n~~r~$-100", 5000, 1); ChangeVehicleColor(vehid, color1, color2); SetVehicleToRespawn(vehid); SetVehicleHealth(vehid, OldCarHP); UpdateVehicleDamageStatus(vehid, panels, doors, lights, tires); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); OnCarUpdate(); 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][pPcarkey2]==-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][pPcarkey3]==-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 Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires; new car = PlayerInfo[playerid][pPcarkey]; GetPlayerName(playerid, playername, sizeof(playername)); if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey]][cOwner], true) == 0) { GetVehicleDamageStatus(car,panels,doors,lights,tires); GetVehicleHealth(car, CarHP); OldCarHP = CarHP; GameTextForPlayer(playerid, "~w~Masina personala~n~~g~Tractata cu succes~n~~r~$-1500", 5000, 1); GivePlayerMoney(playerid,-1500); SetVehicleToRespawn(car); SetVehicleHealth(car, OldCarHP); UpdateVehicleDamageStatus(car, panels, doors, lights, tires); 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 Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires; new car = PlayerInfo[playerid][pPcarkey2]; GetPlayerName(playerid, playername, sizeof(playername)); if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey2]][cOwner], true) == 0) { GetVehicleDamageStatus(car,panels,doors,lights,tires); GetVehicleHealth(car, CarHP); OldCarHP = CarHP; GameTextForPlayer(playerid, "~w~Masina personala~n~~g~Tractata cu succes~n~~r~$-1500", 5000, 1); GivePlayerMoney(playerid,-1500); SetVehicleToRespawn(car); SetVehicleHealth(car, OldCarHP); UpdateVehicleDamageStatus(car, panels, doors, lights, tires); 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 Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires; new car = PlayerInfo[playerid][pPcarkey3]; GetPlayerName(playerid, playername, sizeof(playername)); if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey3]][cOwner], true) == 0) { GetVehicleDamageStatus(car,panels,doors,lights,tires); GetVehicleHealth(car, CarHP); OldCarHP = CarHP; GameTextForPlayer(playerid, "~w~Masina personala~n~~g~Tractata cu succes~n~~r~$-1500", 5000, 1); GivePlayerMoney(playerid,-1500); SetVehicleToRespawn(car); SetVehicleHealth(car, OldCarHP); UpdateVehicleDamageStatus(car, panels, doors, lights, tires); 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,"fix1",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 personala~n~~g~Reparata cu succes~n~~r~$-2500", 5000, 1); GivePlayerMoney(playerid,-2500); 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,"fix2",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 personala~n~~g~Reparata cu succes~n~~r~$-2500", 5000, 1); GivePlayerMoney(playerid,-2500); 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,"fix3",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 personala~n~~g~Reparata cu succes~n~~r~$-2500", 5000, 1); GivePlayerMoney(playerid,-2500); 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, "____________[Personal Vehicle Help]____________"); SendClientMessage(playerid, COLOR_WHITE, "** {1AFF00}(/v)ehicle {09DFF7}[name]"); SendClientMessage(playerid, COLOR_WHITE, "**park, color, tow(1-3), fix(1-3), locate(1-3)"); return 1; } } return 1; } Aici sunt toate comenzile /vehicle, acelea find: park, color, tow(1-3), fix(1-3), locate(1-3) Comanda esential este stabilita pentru 3 masini personale, sa aibe 3 masini personale, ca si aici: Locate (1-2-3) else if(strcmp(x_nr,"locate1",true) == 0) else if(strcmp(x_nr,"locate2",true) == 0) else if(strcmp(x_nr,"locate3",true) == 0) Tow (1-2-3) else if(strcmp(x_nr,"tow1",true) == 0) else if(strcmp(x_nr,"tow2",true) == 0) else if(strcmp(x_nr,"tow3",true) == 0) Fix (1-2-3) else if(strcmp(x_nr,"fix1",true) == 0) else if(strcmp(x_nr,"fix2",true) == 0) else if(strcmp(x_nr,"fix3",true) == 0) Rareori ne gândim la ceea ce avem, dar mereu la ceea ce ne lipseşte
crazyzee Posted April 4, 2013 Author Posted April 4, 2013 Dupce am adaugat /vehicles de la tine in locul celei care o aveam eu m cand am dat compile nu imi da nici o eroare dar .amx ramane salvat la 0 kbp RPG.VIBEPLAY.RORecomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!
crazyzee Posted April 5, 2013 Author Posted April 5, 2013 ma ajuta si pe mine cineva aici va rog ... RPG.VIBEPLAY.RORecomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!
Gireada Posted April 5, 2013 Posted April 5, 2013 Eu ce ziceam ca o sa postezi tot gm-ul tau pe bucati.[pawn]if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) // By LordMan { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You need to login first ! "); return 1; } if(PlayerInfo[playerid][pCarBan] == 1) { SendClientMessage(playerid, COLOR_GREY, " You'r banned to use /v commands ! "); return 1; } if(PlayerInfo[playerid][pLevel] >= 3 && PlayerInfo[playerid][pConnectTime] >= 36) { 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, color, create"); return 1; } else if(strcmp(x_nr,"park",true) == 0) { if(PlayerInfo[playerid][pCar] == 9999) { SendClientMessage(playerid, COLOR_GREY, "You don't own a car."); return 1; } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new carid = GetPlayerVehicleID(playerid); if(carid == PlayerInfo[playerid][pCar]) { new Float:x,Float:y,Float:z; new Float:a; GetPlayerName(playerid, playername, sizeof(playername)); GetVehiclePos(carid, x, y, z); GetVehicleZAngle(carid, a); CarInfo[carid][cLocationx] = x; CarInfo[carid][cLocationy] = y; CarInfo[carid][cLocationz] = z; CarInfo[carid][cAngle] = a; SetVehiclePos(carid, x, y, z); SetVehicleZAngle(carid, a); format(string, sizeof(string), "You have saved your vehicle at the position %f.01, %f.01, %f.01, Remember it, it will respawn here!",x,y,z); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); SaveCar(carid); SetVehicleToRespawn(carid); } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in your car."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in a car."); return 1; } return 1; } else if(strcmp(x_nr,"color",true) == 0) { if(PlayerInfo[playerid][pCar] == 9999) { SendClientMessage(playerid, COLOR_GREY,"* You don't have a vehicle to respray."); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } if(GetPlayerMoney(playerid) < 50000) { SendClientMessage(playerid, COLOR_GREY, " Nu ai suficienti bani!"); return 1; } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new vehid = GetPlayerVehicleID(playerid); new Float:x, Float:y, Float:x, Float:a; if(CarInfo[vehid][cID] == PlayerInfo[playerid][pCar]) { CarInfo[vehid][cColorOne] = color1; CarInfo[vehid][cColorTwo] = color2; ChangeVehicleColor(vehid, color1, color2); GetVehiclePos(vehid, x, y, z); GetVehicleZAngle(vehid, a); SetVehiclePos(vehid, x, y, z); SetVehicleZAngle(vehid, a); GivePlayerMoney(playerid, -50000); SendClientMessage(playerid, COLOR_WHITE, "Ti-ai modificat culoarea!"); SaveCar(vehid);SetVehicleToRespawn(vehid); } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in your car."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in a car."); return 1; } return 1; } else if(strcmp(x_nr,"create",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 && color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 && color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } new car = 0; if(PlayerInfo[playerid][pCar] == 9999) { } else return SendClientMessage(playerid, COLOR_GREY,"* You already own a car!"); for(new h = 760; h < sizeof(CarInfo); h++) { if(CarInfo[h][cOwned] == 0) { car = h; h = 1300; } } new Float:AX,Float:AY,Float:AZ,Float:Angle; GetPlayerPos(playerid, AX,AY,AZ); GetPlayerFacingAngle(playerid, Angle); format(string, 128, "cars/%d.ini", car); new playername2[MAX_PLAYER_NAME]; playername2 = PlayerName(playerid); if(dini_Exists(string)) { CarInfo[car][cID] = car; CarInfo[car][cOwned] = 1; strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999); CarInfo[car][cLocationx] = AX; CarInfo[car][cLocationy] = AY; CarInfo[car][cLocationz] = AZ; CarInfo[car][cAngle] = Angle; CarInfo[car][cModel] = 522; CarInfo[car][cColorOne] = color1; CarInfo[car][cColorTwo] = color2; SaveCar(car); } else { dini_Create(string); CarInfo[car][cID] = car; CarInfo[car][cOwned] = 1; strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999); CarInfo[car][cLocationx] = AX; CarInfo[car][cLocationy] = AY; CarInfo[car][cLocationz] = AZ; CarInfo[car][cAngle] = Angle; CarInfo[car][cModel] = 522; CarInfo[car][cColorOne] = color1; CarInfo[car][cColorTwo] = color2; SaveCar(car); } PlayerInfo[playerid][pCar] = car; ownedcar[car] = CreateVehicle(522,CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],CarInfo[car][cAngle],CarInfo[car][cColorOne],CarInfo[car][cColorTwo],300); SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!"); SendClientMessage(playerid, COLOR_GRAD2, "Type /vehicle to view the vehicle manual!"); GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget where you placed you'r new ~b~car!", 5000, 3); } else { SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]"); SendClientMessage(playerid, COLOR_WHITE, "Available names: color, park, create"); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD2, "Trebuie sa ai level 3 si 36 ore pe server!"); return 1; } } return 1; }[/pawn]
crazyzee Posted April 5, 2013 Author Posted April 5, 2013 Eu ce ziceam ca o sa postezi tot gm-ul tau pe bucati.[pawn]if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) // By LordMan { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You need to login first ! "); return 1; } if(PlayerInfo[playerid][pCarBan] == 1) { SendClientMessage(playerid, COLOR_GREY, " You'r banned to use /v commands ! "); return 1; } if(PlayerInfo[playerid][pLevel] >= 3 && PlayerInfo[playerid][pConnectTime] >= 36) { 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, color, create"); return 1; } else if(strcmp(x_nr,"park",true) == 0) { if(PlayerInfo[playerid][pCar] == 9999) { SendClientMessage(playerid, COLOR_GREY, "You don't own a car."); return 1; } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new carid = GetPlayerVehicleID(playerid); if(carid == PlayerInfo[playerid][pCar]) { new Float:x,Float:y,Float:z; new Float:a; GetPlayerName(playerid, playername, sizeof(playername)); GetVehiclePos(carid, x, y, z); GetVehicleZAngle(carid, a); CarInfo[carid][cLocationx] = x; CarInfo[carid][cLocationy] = y; CarInfo[carid][cLocationz] = z; CarInfo[carid][cAngle] = a; SetVehiclePos(carid, x, y, z); SetVehicleZAngle(carid, a); format(string, sizeof(string), "You have saved your vehicle at the position %f.01, %f.01, %f.01, Remember it, it will respawn here!",x,y,z); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); SaveCar(carid); SetVehicleToRespawn(carid); } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in your car."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in a car."); return 1; } return 1; } else if(strcmp(x_nr,"color",true) == 0) { if(PlayerInfo[playerid][pCar] == 9999) { SendClientMessage(playerid, COLOR_GREY,"* You don't have a vehicle to respray."); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } if(GetPlayerMoney(playerid) < 50000) { SendClientMessage(playerid, COLOR_GREY, " Nu ai suficienti bani!"); return 1; } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new vehid = GetPlayerVehicleID(playerid); new Float:x, Float:y, Float:x, Float:a; if(CarInfo[vehid][cID] == PlayerInfo[playerid][pCar]) { CarInfo[vehid][cColorOne] = color1; CarInfo[vehid][cColorTwo] = color2; ChangeVehicleColor(vehid, color1, color2); GetVehiclePos(vehid, x, y, z); GetVehicleZAngle(vehid, a); SetVehiclePos(vehid, x, y, z); SetVehicleZAngle(vehid, a); GivePlayerMoney(playerid, -50000); SendClientMessage(playerid, COLOR_WHITE, "Ti-ai modificat culoarea!"); SaveCar(vehid);SetVehicleToRespawn(vehid); } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in your car."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in a car."); return 1; } return 1; } else if(strcmp(x_nr,"create",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 && color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 && color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } new car = 0; if(PlayerInfo[playerid][pCar] == 9999) { } else return SendClientMessage(playerid, COLOR_GREY,"* You already own a car!"); for(new h = 760; h < sizeof(CarInfo); h++) { if(CarInfo[h][cOwned] == 0) { car = h; h = 1300; } } new Float:AX,Float:AY,Float:AZ,Float:Angle; GetPlayerPos(playerid, AX,AY,AZ); GetPlayerFacingAngle(playerid, Angle); format(string, 128, "cars/%d.ini", car); new playername2[MAX_PLAYER_NAME]; playername2 = PlayerName(playerid); if(dini_Exists(string)) { CarInfo[car][cID] = car; CarInfo[car][cOwned] = 1; strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999); CarInfo[car][cLocationx] = AX; CarInfo[car][cLocationy] = AY; CarInfo[car][cLocationz] = AZ; CarInfo[car][cAngle] = Angle; CarInfo[car][cModel] = 522; CarInfo[car][cColorOne] = color1; CarInfo[car][cColorTwo] = color2; SaveCar(car); } else { dini_Create(string); CarInfo[car][cID] = car; CarInfo[car][cOwned] = 1; strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999); CarInfo[car][cLocationx] = AX; CarInfo[car][cLocationy] = AY; CarInfo[car][cLocationz] = AZ; CarInfo[car][cAngle] = Angle; CarInfo[car][cModel] = 522; CarInfo[car][cColorOne] = color1; CarInfo[car][cColorTwo] = color2; SaveCar(car); } PlayerInfo[playerid][pCar] = car; ownedcar[car] = CreateVehicle(522,CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],CarInfo[car][cAngle],CarInfo[car][cColorOne],CarInfo[car][cColorTwo],300); SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!"); SendClientMessage(playerid, COLOR_GRAD2, "Type /vehicle to view the vehicle manual!"); GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget where you placed you'r new ~b~car!", 5000, 3); } else { SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]"); SendClientMessage(playerid, COLOR_WHITE, "Available names: color, park, create"); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD2, "Trebuie sa ai level 3 si 36 ore pe server!"); return 1; } } return 1; }[/pawn]Imi da eroarea asta acum ...[pawn]D:\BACKUP~1\GAMEMO~1\GODFAT~1.PWN(15710) : error 021: symbol already defined: "x"D:\BACKUP~1\GAMEMO~1\GODFAT~1.PWN(15716) : error 017: undefined symbol "z"D:\BACKUP~1\GAMEMO~1\GODFAT~1.PWN(15718) : error 017: undefined symbol "z"D:\BACKUP~1\GAMEMO~1\GODFAT~1.PWN(15710) : warning 203: symbol is never used: "x"Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase3 Errors.[/pawn] RPG.VIBEPLAY.RORecomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!
Gireada Posted April 5, 2013 Posted April 5, 2013 [pawn]if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) // By LordMan { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You need to login first ! "); return 1; } if(PlayerInfo[playerid][pCarBan] == 1) { SendClientMessage(playerid, COLOR_GREY, " You'r banned to use /v commands ! "); return 1; } if(PlayerInfo[playerid][pLevel] >= 3 && PlayerInfo[playerid][pConnectTime] >= 36) { 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, color, create"); return 1; } else if(strcmp(x_nr,"park",true) == 0) { if(PlayerInfo[playerid][pCar] == 9999) { SendClientMessage(playerid, COLOR_GREY, "You don't own a car."); return 1; } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new carid = GetPlayerVehicleID(playerid); if(carid == PlayerInfo[playerid][pCar]) { new Float:x,Float:y,Float:z; new Float:a; GetPlayerName(playerid, playername, sizeof(playername)); GetVehiclePos(carid, x, y, z); GetVehicleZAngle(carid, a); CarInfo[carid][cLocationx] = x; CarInfo[carid][cLocationy] = y; CarInfo[carid][cLocationz] = z; CarInfo[carid][cAngle] = a; SetVehiclePos(carid, x, y, z); SetVehicleZAngle(carid, a); format(string, sizeof(string), "You have saved your vehicle at the position %f.01, %f.01, %f.01, Remember it, it will respawn here!",x,y,z); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); SaveCar(carid); SetVehicleToRespawn(carid); } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in your car."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in a car."); return 1; } return 1; } else if(strcmp(x_nr,"color",true) == 0) { if(PlayerInfo[playerid][pCar] == 9999) { SendClientMessage(playerid, COLOR_GREY,"* You don't have a vehicle to respray."); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } if(GetPlayerMoney(playerid) < 50000) { SendClientMessage(playerid, COLOR_GREY, " Nu ai suficienti bani!"); return 1; } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new vehid = GetPlayerVehicleID(playerid); new Float:x, Float:y, Float:z, Float:a; if(CarInfo[vehid][cID] == PlayerInfo[playerid][pCar]) { CarInfo[vehid][cColorOne] = color1; CarInfo[vehid][cColorTwo] = color2; ChangeVehicleColor(vehid, color1, color2); GetVehiclePos(vehid, x, y, z); GetVehicleZAngle(vehid, a); SetVehiclePos(vehid, x, y, z); SetVehicleZAngle(vehid, a); GivePlayerMoney(playerid, -50000); SendClientMessage(playerid, COLOR_WHITE, "Ti-ai modificat culoarea!"); SaveCar(vehid);SetVehicleToRespawn(vehid); } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in your car."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in a car."); return 1; } return 1; } else if(strcmp(x_nr,"create",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 && color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 && color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } new car = 0; if(PlayerInfo[playerid][pCar] == 9999) { } else return SendClientMessage(playerid, COLOR_GREY,"* You already own a car!"); for(new h = 760; h < sizeof(CarInfo); h++) { if(CarInfo[h][cOwned] == 0) { car = h; h = 1300; } } new Float:AX,Float:AY,Float:AZ,Float:Angle; GetPlayerPos(playerid, AX,AY,AZ); GetPlayerFacingAngle(playerid, Angle); format(string, 128, "cars/%d.ini", car); new playername2[MAX_PLAYER_NAME]; playername2 = PlayerName(playerid); if(dini_Exists(string)) { CarInfo[car][cID] = car; CarInfo[car][cOwned] = 1; strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999); CarInfo[car][cLocationx] = AX; CarInfo[car][cLocationy] = AY; CarInfo[car][cLocationz] = AZ; CarInfo[car][cAngle] = Angle; CarInfo[car][cModel] = 522; CarInfo[car][cColorOne] = color1; CarInfo[car][cColorTwo] = color2; SaveCar(car); } else { dini_Create(string); CarInfo[car][cID] = car; CarInfo[car][cOwned] = 1; strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999); CarInfo[car][cLocationx] = AX; CarInfo[car][cLocationy] = AY; CarInfo[car][cLocationz] = AZ; CarInfo[car][cAngle] = Angle; CarInfo[car][cModel] = 522; CarInfo[car][cColorOne] = color1; CarInfo[car][cColorTwo] = color2; SaveCar(car); } PlayerInfo[playerid][pCar] = car; ownedcar[car] = CreateVehicle(522,CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],CarInfo[car][cAngle],CarInfo[car][cColorOne],CarInfo[car][cColorTwo],300); SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!"); SendClientMessage(playerid, COLOR_GRAD2, "Type /vehicle to view the vehicle manual!"); GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget where you placed you'r new ~b~car!", 5000, 3); } else { SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]"); SendClientMessage(playerid, COLOR_WHITE, "Available names: color, park, create"); return 1; } }[/pawn] else { SendClientMessage(playerid, COLOR_GRAD2, "Trebuie sa ai level 3 si 36 ore pe server!"); return 1; } } return 1; }[/pawn]
Extassy Posted April 5, 2013 Posted April 5, 2013 uite aici comanda care sigur iti v-a merge ca eu o folosesc si merge perfectif(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) // By Extassy { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You need to login first ! "); return 1; } if(PlayerInfo[playerid][pCarBan] == 1) { SendClientMessage(playerid, COLOR_GREY, " You'r banned to use /v commands ! "); return 1; } if(PlayerInfo[playerid][pLevel] >= 5 && PlayerInfo[playerid][pConnectTime] >= 0) { 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, color, create"); return 1; } else if(strcmp(x_nr,"park",true) == 0) { if(PlayerInfo[playerid][pCar] == 9999) { SendClientMessage(playerid, COLOR_GREY, "You don't own a car."); return 1; } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new carid = GetPlayerVehicleID(playerid); if(carid == PlayerInfo[playerid][pCar]) { new Float:x,Float:y,Float:z; new Float:a; GetPlayerName(playerid, playername, sizeof(playername)); GetVehiclePos(carid, x, y, z); GetVehicleZAngle(carid, a); CarInfo[carid][cLocationx] = x; CarInfo[carid][cLocationy] = y; CarInfo[carid][cLocationz] = z; CarInfo[carid][cAngle] = a; format(string, sizeof(string), "You have saved your vehicle at the position %f.01, %f.01, %f.01, Remember it, it will respawn here!",x,y,z); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); SaveCar(carid); } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in your car."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in a car."); return 1; } return 1; } else if(strcmp(x_nr,"color",true) == 0) { if(PlayerInfo[playerid][pCar] == 9999) { SendClientMessage(playerid, COLOR_GREY,"* You don't have a vehicle to respray."); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 && color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 && color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } if(GetPlayerMoney(playerid) < 50000) { SendClientMessage(playerid, COLOR_GREY, " Nu ai suficienti bani!"); return 1; } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new vehid = GetPlayerVehicleID(playerid); if(CarInfo[vehid][cID] == PlayerInfo[playerid][pCar]) { CarInfo[vehid][cColorOne] = color1; CarInfo[vehid][cColorTwo] = color2; ChangeVehicleColor(vehid, color1, color2); GivePlayerMoney(playerid, -50000); SendClientMessage(playerid, COLOR_WHITE, "Ti-ai modificat culoarea!"); SaveCar(vehid); } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in your car."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "You'r not in a car."); return 1; } return 1; } else if(strcmp(x_nr,"create",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 && color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 && color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Wrong color id!"); return 1; } new car = 0; if(PlayerInfo[playerid][pCar] == 9999) { } else return SendClientMessage(playerid, COLOR_GREY,"* You already own a car!"); for(new h = 721; h < sizeof(CarInfo); h++) { if(CarInfo[h][cOwned] == 0) { car = h; h = 1300; } } new Float:AX,Float:AY,Float:AZ,Float:Angle; GetPlayerPos(playerid, AX,AY,AZ); GetPlayerFacingAngle(playerid, Angle); format(string, 128, "cars/%d.ini", car); new playername2[MAX_PLAYER_NAME]; playername2 = PlayerName(playerid); if(dini_Exists(string)) { CarInfo[car][cID] = car; CarInfo[car][cOwned] = 1; strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999); CarInfo[car][cLocationx] = AX; CarInfo[car][cLocationy] = AY; CarInfo[car][cLocationz] = AZ; CarInfo[car][cAngle] = Angle; CarInfo[car][cModel] = 522; CarInfo[car][cColorOne] = color1; CarInfo[car][cColorTwo] = color2; SaveCar(car); } else { dini_Create(string); CarInfo[car][cID] = car; CarInfo[car][cOwned] = 1; strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999); CarInfo[car][cLocationx] = AX; CarInfo[car][cLocationy] = AY; CarInfo[car][cLocationz] = AZ; CarInfo[car][cAngle] = Angle; CarInfo[car][cModel] = 522; CarInfo[car][cColorOne] = color1; CarInfo[car][cColorTwo] = color2; SaveCar(car); } PlayerInfo[playerid][pCar] = car; ownedcar[car] = CreateVehicle(522,CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],CarInfo[car][cAngle],CarInfo[car][cColorOne],CarInfo[car][cColorTwo],300); SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!"); SendClientMessage(playerid, COLOR_GRAD2, "Type /vehicle to view the vehicle manual!"); GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget where you placed you'r new ~b~car!", 5000, 3); } else { SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]"); SendClientMessage(playerid, COLOR_WHITE, "Available names: color, park, create"); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD2, "Trebuie sa ai level 5 pe server!"); return 1; } } return 1; }
crazyzee Posted April 5, 2013 Author Posted April 5, 2013 Acum cand vreau sa ma urc in orice masina dupa server imi zice [pawn]23:35:36] Acest vehicul apartine lui{FFFFFF} ![23:35:39] Acest vehicul apartine lui{FFFFFF} ![23:35:44] Acest vehicul apartine lui{FFFFFF} ![23:35:46] Acest vehicul apartine lui{FFFFFF} ![/pawn]nu doar la cele personale , la toate masinile dupa server ... merge sa ma urc in ele doar daca ma pun /aod si atunci imi da mesajul asta [pawn][23:37:57] Poti conduce vehiculul lui deoarece esti On Duty![23:38:09] Poti conduce vehiculul lui deoarece esti On Duty![/pawn] .. insa asa le pot conduce pe toate .. RPG.VIBEPLAY.RORecomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!
Gireada Posted April 5, 2013 Posted April 5, 2013 Sigur lui nu o sai mearga deoarece vehiculul trebuie respaunat pentru asi face efectulAi sistemul de vehicule buguit
crazyzee Posted April 5, 2013 Author Posted April 5, 2013 Pai si de unde sa iau alt sistem bun man , sau cum sa fac , trebe sa existe o rezolvare si la mine nu ?Am rezolvat erorile alea , le facuse unu inainte tot asa incercand sa repare sistemul.La acest sistem dat de tine Extassy cand dau /v park imi zice You are not in your vehicle , banuiesc ca problema e de la ceea ce spune si gireada , dar banuiesc ca tre sa existe si la mine o rezolvare. RPG.VIBEPLAY.RORecomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!
Question
crazyzee
Am ceva probleme la scriptul de masini personale !
1. Cand dau /v park nu se parcheaza masina unde vreau eu
2. /v color nu merge sa schimb culoarea
3. masina vreau sa nu o poata conduce decat proprietaru , daca incearca cineva sa o ia sa il dea jos automat .
Aici este scriptul ...
[pawn]if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) // By LordMan
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You need to login first ! ");
return 1;
}
if(PlayerInfo[playerid][pCarBan] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You'r banned to use /v commands ! ");
return 1;
}
if(PlayerInfo[playerid][pLevel] >= 3 && PlayerInfo[playerid][pConnectTime] >= 36)
{
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, color, create");
return 1;
}
else if(strcmp(x_nr,"park",true) == 0)
{
if(PlayerInfo[playerid][pCar] == 9999)
{
SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new carid = GetPlayerVehicleID(playerid);
if(carid == PlayerInfo[playerid][pCar])
{
new Float:x,Float:y,Float:z;
new Float:a;
GetPlayerName(playerid, playername, sizeof(playername));
GetVehiclePos(carid, x, y, z);
GetVehicleZAngle(carid, a);
CarInfo[carid][cLocationx] = x;
CarInfo[carid][cLocationy] = y;
CarInfo[carid][cLocationz] = z;
CarInfo[carid][cAngle] = a;
format(string, sizeof(string), "You have saved your vehicle at the position %f.01, %f.01, %f.01, Remember it, it will respawn here!",x,y,z);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SaveCar(carid);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You'r not in your car.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You'r not in a car.");
return 1;
}
return 1;
}
else if(strcmp(x_nr,"color",true) == 0)
{
if(PlayerInfo[playerid][pCar] == 9999)
{
SendClientMessage(playerid, COLOR_GREY,"* You don't have a vehicle to respray.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 && color1 > 126)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 && color2 > 126)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
return 1;
}
if(GetPlayerMoney(playerid) < 50000)
{
SendClientMessage(playerid, COLOR_GREY, " Nu ai suficienti bani!");
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehid = GetPlayerVehicleID(playerid);
if(CarInfo[vehid][cID] == PlayerInfo[playerid][pCar])
{
CarInfo[vehid][cColorOne] = color1;
CarInfo[vehid][cColorTwo] = color2;
ChangeVehicleColor(vehid, color1, color2);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_WHITE, "Ti-ai modificat culoarea!");
SaveCar(vehid);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You'r not in your car.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You'r not in a car.");
return 1;
}
return 1;
}
else if(strcmp(x_nr,"create",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 && color1 > 126)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 && color2 > 126)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
return 1;
}
new car = 0;
if(PlayerInfo[playerid][pCar] == 9999) { }
else return SendClientMessage(playerid, COLOR_GREY,"* You already own a car!");
for(new h = 760; h < sizeof(CarInfo); h++)
{
if(CarInfo[h][cOwned] == 0)
{
car = h;
h = 1300;
}
}
new Float:AX,Float:AY,Float:AZ,Float:Angle;
GetPlayerPos(playerid, AX,AY,AZ);
GetPlayerFacingAngle(playerid, Angle);
format(string, 128, "cars/%d.ini", car);
new playername2[MAX_PLAYER_NAME];
playername2 = PlayerName(playerid);
if(dini_Exists(string))
{
CarInfo[car][cID] = car;
CarInfo[car][cOwned] = 1;
strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999);
CarInfo[car][cLocationx] = AX;
CarInfo[car][cLocationy] = AY;
CarInfo[car][cLocationz] = AZ;
CarInfo[car][cAngle] = Angle;
CarInfo[car][cModel] = 522;
CarInfo[car][cColorOne] = color1;
CarInfo[car][cColorTwo] = color2;
SaveCar(car);
}
else
{
dini_Create(string);
CarInfo[car][cID] = car;
CarInfo[car][cOwned] = 1;
strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999);
CarInfo[car][cLocationx] = AX;
CarInfo[car][cLocationy] = AY;
CarInfo[car][cLocationz] = AZ;
CarInfo[car][cAngle] = Angle;
CarInfo[car][cModel] = 522;
CarInfo[car][cColorOne] = color1;
CarInfo[car][cColorTwo] = color2;
SaveCar(car);
}
PlayerInfo[playerid][pCar] = car;
ownedcar[car] = CreateVehicle(522,CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],CarInfo[car][cAngle],CarInfo[car][cColorOne],CarInfo[car][cColorTwo],300);
SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
SendClientMessage(playerid, COLOR_GRAD2, "Type /vehicle to view the vehicle manual!");
GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget where you placed you'r new ~b~car!", 5000, 3);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");
SendClientMessage(playerid, COLOR_WHITE, "Available names: color, park, create");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Trebuie sa ai level 3 si 36 ore pe server!");
return 1;
}
}
return 1;
}[/pawn]
RPG.VIBEPLAY.RO
Recomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!
10 answers to this question
Recommended Posts