Jump to content

Klaudiu01

Membru
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by Klaudiu01

  1. Am sa incerc acest gamemode sa vad cum ii. Am sa fiu foarte atent dupa un bug foarte mare! Ca pe toate gm care le incerc au bug cu masinile personale si se pun random in loc sa fie la locul lor. Revin cu un edit la acest post.
  2. Pai te duci si deschizi gamemode-ul in pawno si faci: 1. Cauti sa vezi cum functioneaza sistemul de masini.(cel mai bine vezi la o comanda de genu /acreatecar sau /v buy sau /buycar sau depinde de gamemode ) [pawn]enum pInfo { pKey[128], pLevel, pAdmin, pHelper, pCrashed, pPcarkey, pPcarkey2, pPcarkey3, pDonateRank, gPupgrade }[/pawn] 2. La mine pe gamemode sistemul functioneaza cu pCarKey si Car_Info {cOwner, cOwner bla bla). Te duci si stergi din enum pInfo { Pass, pAdmin } linia unde este pCarKey sau depinde ce este in gm tau. 3. Dupa te duci la enumeratia (enum {}) unde sunt informatiile despre masini la mine fiind Car_Info Si stergi tot de acolo [pawn]new carsonserver = 755; enum cInfo { cModel, Float:cLocationx, Float:cLocationy, Float:cLocationz, Float:cAngle, cColorOne, cColorTwo, cOwner[MAX_PLAYER_NAME], cDescription[12], cValue, cLicense[14], cRegistration, cOwned, cLock, mod1, mod2, mod3, mod4, mod5, mod6, mod7, mod8, mod9, mod10, mod11, mod12, mod13, mod14, mod15, mod16, mod17, paintjob, }; new CarInfo[1000][cInfo]; [/pawn] 4. Verifici sa stergi tot ce contine pCarKey si cOwned si restu [pawn] PlayerInfo[playerid][spawnDance] = true; ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1); //preventing a bug for the animation not being applied the first time OnPlayerRequestClass is called OnCarUpdate(); OnPropUpdate(); 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]); }[/pawn] [pawn] if(IsAnOwnableCar(newcar)) { if(CarInfo[newcar][cOwned]==1) { format(string,sizeof(string),"* Vehiculul privat al jucatorului {ffffff}%s",CarInfo[newcar][cOwner]); SendClientMessage(playerid, COLOR_ORANGE, string); if(PlayerInfo[playerid][pPcarkey] == vehicle) { } else if(PlayerInfo[playerid][pPcarkey2] == vehicle) { } else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { } else { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_GREY, "* Nu detii keyle acestei masini."); } } }[/pawn] Asta ii de la sistemul de DealerShip care ii pe gm meu. [pawn]if(listitem==0) { if (GetPlayerMoney(playerid) >= 100000) { GivePlayerMoney(playerid,-100000); //infernus new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z); new thiscar = CreateVehicle(411,X,Y,Z,1,0,0,99999999); if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; } else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; } else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; } else { return 1; } CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 411; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0; CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1; CarInfo[thiscar][cValue] = 90000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1; PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername)); strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid); 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!"); SendClientMessage(playerid, COLOR_GRAD2, "Scrie /v pentru manualul masini!"); format(CarInfo[thiscar][cDescription], 32, "Infernus"); OnCarUpdate(); SavePlayerData(playerid); } else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }[/pawn] [pawn] 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][cValue], 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][cValue], 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][cValue], CarInfo[carkey3][cColorOne], CarInfo[carkey3][cColorTwo], CarInfo[carkey3][cLock]); SendClientMessage(playerid, COLOR_GRAD5,string); } } return 1; }[/pawn] [pawn]PUBLIC: OnCarUpdate() { 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,%s,%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][cOwner], CarInfo[idx][cDescription], CarInfo[idx][cValue], CarInfo[idx][cLicense], CarInfo[idx][cOwned], CarInfo[idx][cLock], 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("personalcars.cfg", io_write); } else { file2 = fopen("personalcars.cfg", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } return 1; } PUBLIC: LoadComponents(vehicleid) { if(CarInfo[vehicleid][cOwned] == 1) { if(CarInfo[vehicleid][mod1] >= 1000 && CarInfo[vehicleid][mod1] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod1])) != CarInfo[vehicleid][mod1]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod1]); } } if(CarInfo[vehicleid][mod2] >= 1000 && CarInfo[vehicleid][mod2] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod2])) != CarInfo[vehicleid][mod2]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod2]); } } if(CarInfo[vehicleid][mod3] >= 1000 && CarInfo[vehicleid][mod3] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod3])) != CarInfo[vehicleid][mod3]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod3]); } } if(CarInfo[vehicleid][mod4] >= 1000 && CarInfo[vehicleid][mod4] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod4])) != CarInfo[vehicleid][mod4]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod4]); } } if(CarInfo[vehicleid][mod5] >= 1000 && CarInfo[vehicleid][mod5] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod5])) != CarInfo[vehicleid][mod5]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod5]); } } if(CarInfo[vehicleid][mod6] >= 1000 && CarInfo[vehicleid][mod6] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod6])) != CarInfo[vehicleid][mod6]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod6]); } } if(CarInfo[vehicleid][mod7] >= 1000 && CarInfo[vehicleid][mod7] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod7])) != CarInfo[vehicleid][mod7]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod7]); } } if(CarInfo[vehicleid][mod8] >= 1000 && CarInfo[vehicleid][mod8] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod8])) != CarInfo[vehicleid][mod8]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod8]); } } if(CarInfo[vehicleid][mod9] >= 1000 && CarInfo[vehicleid][mod9] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod9])) != CarInfo[vehicleid][mod9]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod9]); } } if(CarInfo[vehicleid][mod10] >= 1000 && CarInfo[vehicleid][mod10] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod10])) != CarInfo[vehicleid][mod10]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod10]); } } if(CarInfo[vehicleid][mod11] >= 1000 && CarInfo[vehicleid][mod11] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod11])) != CarInfo[vehicleid][mod11]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod11]); } } if(CarInfo[vehicleid][mod12] >= 1000 && CarInfo[vehicleid][mod12] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod12])) != CarInfo[vehicleid][mod12]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod12]); } } if(CarInfo[vehicleid][mod13] >= 1000 && CarInfo[vehicleid][mod13] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod13])) != CarInfo[vehicleid][mod13]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod13]); } } if(CarInfo[vehicleid][mod14] >= 1000 && CarInfo[vehicleid][mod14] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod14])) != CarInfo[vehicleid][mod14]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod14]); } } if(CarInfo[vehicleid][mod15] >= 1000 && CarInfo[vehicleid][mod15] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod15])) != CarInfo[vehicleid][mod15]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod15]); } } if(CarInfo[vehicleid][mod16] >= 1000 && CarInfo[vehicleid][mod16] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod16])) != CarInfo[vehicleid][mod16]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod16]); } } if(CarInfo[vehicleid][mod17] >= 1000 && CarInfo[vehicleid][mod17] <= 1193) { if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod17])) != CarInfo[vehicleid][mod17]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod17]); } } if(CarInfo[vehicleid][paintjob] > -1) { ChangeVehiclePaintjob(vehicleid,CarInfo[vehicleid][paintjob]); ChangeVehicleColor(vehicleid, 1, 1); } else { ChangeVehicleColor(vehicleid, CarInfo[vehicleid][cColorOne], CarInfo[vehicleid][cColorTwo]); } if(CarInfo[vehicleid][cLicense] > 0) { SetVehicleNumberPlate(vehicleid,CarInfo[vehicleid][cLicense]); } } return 1; } /*----------Car Save Functions----------*/ PUBLIC: LoadCar() { new arrCoords[31][64]; new strFromFile2[256]; new File: file = fopen("personalcars.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; } 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|%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("personalcars.cfg", io_write); } else { file2 = fopen("personalcars.cfg", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } return 1; } [/pawn] Si dupa ce ai verificat sa nu ramana variabile si tot felu de la sistemul de masini Stergi din configuri masinile si tot, ca stau acolo degeaba dupa Daca ti-am fost de ajutor dami un rep ;)
  3. Nume: Klaudiu01 Problema: Dau compile si nu am nici o eroare, dar cand il pun pe server sa vad daca merge comenzile de admin functioneaza la oricine. :| Eroare: [pawn]Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase[/pawn] Script/Linii: [pawn] /**************************************************** * User System and some Admin Funtions * * By Johny A.K.A Klaudiu * * If you want to use this code in * * your fs/gm leave credits! * ****************************************************/ //----------------------------=<[includes]>=------------------------------------ #include <a_samp> #include <dini> #include <dutils> #pragma unused ret_memcpy //----------------------------=<[Defines]>=------------------------------------- #define FILTERSCRIPT #if defined FILTERSCRIPT #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 #define COLOUR_GREEN 0x33AA33AA #define COLOUR_RED 0xAA3333AA #define COLOUR_YELLOW 0xFFFF00AA #define COLOUR_LIGHTBLUE 0x33CCFFAA #define COLOUR_ORANGE 0xFFFFFFAA //#define MAX_PLAYERS 500 #define NO_ADMIN "Ne pare rau, nu esti un admin!" #define PASS_FAIL "[{FF0000}EROARE{FFFFFF}]: Parola gresita!" #define FUCK_YOU "Sugi pula, AI PRIMIT BAN!" #define PlayerFile "AdminScript/Users/%s.ini" #define SettingFile "AdminScript/Settings/MainSettings.ini" #define CommandFile "AdminScript/Settings/Commands.ini" /*enum PLAYER_MAIN_INFO { P_NAME[MAX_PLAYER_NAME], P_IP, P_REGGED, P_PASS, P_LOGGED, P_LEVEL, P_WIRED, P_JAILED } new GlobalPlayerInfo[MAX_PLAYERS][PLAYER_MAIN_INFO];*/ enum SETTINGS_MAIN { POCKET_MONEY, JAIL_COMMANDS, ANNOUNCE_SECONDS, PASS_MIN, PASS_MAX } new gSettings[sETTINGS_MAIN]; enum COMMANDS_MAIN { AKILL, ANNOUNCE, ARMOURALL, BAN, CARHP, EXPLODE, FLIP, GOTO, GETHERE, GIVEARMOUR, GIVEHEALTH, GIVEWEAPON, GOD, HEALALL, IMITATE, IP, KICK, MAXAMMO, PING, SETLEVEL, SETWANTED, TBAN, TIME, WEATHER } new gCommands[COMMANDS_MAIN]; //----------------------------=<[OnFilterScriptInit]>=-------------------------- public OnFilterScriptInit() { print("**********************************"); print("* Admin/User FS by Johny *"); print("**********************************"); if(!fexist(SettingFile)) { dini_Create(SettingFile); dini_IntSet(SettingFile, "PocketMoney", 100000); dini_IntSet(SettingFile, "JailCommands", 0); dini_IntSet(SettingFile, "AnnounceSeconds", 3); dini_IntSet(SettingFile, "PassMin", 3); dini_IntSet(SettingFile, "PassMax", 15); } gSettings[POCKET_MONEY] = dini_Int(SettingFile, "PocketMoney"); gSettings[JAIL_COMMANDS] = dini_Int(SettingFile, "JailCommands"); gSettings[ANNOUNCE_SECONDS] = dini_Int(SettingFile, "AnnounceSeconds"); gSettings[PASS_MIN] = dini_Int(SettingFile, "PassMin"); gSettings[PASS_MAX] = dini_Int(SettingFile, "PassMax"); if(!fexist(CommandFile)) { dini_Create(CommandFile); dini_IntSet(CommandFile, "Akill", 6); dini_IntSet(CommandFile, "Announce", 5); dini_IntSet(CommandFile, "Armourall", 3); dini_IntSet(CommandFile, "Ban", 9); dini_IntSet(CommandFile, "Carhp", 4); dini_IntSet(CommandFile, "Explode", 5); dini_IntSet(CommandFile, "Goto", 4); dini_IntSet(CommandFile, "Gethere", 5); dini_IntSet(CommandFile, "Givearmour", 6); dini_IntSet(CommandFile, "Givehealth", 6); dini_IntSet(CommandFile, "Giveweapon", 7); dini_IntSet(CommandFile, "God", 10); dini_IntSet(CommandFile, "Healall", 7); dini_IntSet(CommandFile, "Imitate", 8); dini_IntSet(CommandFile, "Ip", 2); dini_IntSet(CommandFile, "Kick", 7); dini_IntSet(CommandFile, "Maxammo", 8); dini_IntSet(CommandFile, "Ping", 1); dini_IntSet(CommandFile, "Setlevel", 10); dini_IntSet(CommandFile, "Setwanted", 6); dini_IntSet(CommandFile, "Tban", 9); dini_IntSet(CommandFile, "Time", 3); dini_IntSet(CommandFile, "Weather", 3); } gCommands[AKILL] = dini_Int(CommandFile, "Akill"); gCommands[ANNOUNCE] = dini_Int(CommandFile, "Announce"); gCommands[ARMOURALL] = dini_Int(CommandFile, "Armourall"); gCommands[bAN] = dini_Int(CommandFile, "Ban"); gCommands[CARHP] = dini_Int(CommandFile, "Carhp"); gCommands[EXPLODE] = dini_Int(CommandFile, "Explode"); gCommands[GOTO] = dini_Int(CommandFile, "Goto"); gCommands[GETHERE] = dini_Int(CommandFile, "Gethere"); gCommands[GIVEARMOUR] = dini_Int(CommandFile, "Givearmour"); gCommands[GIVEHEALTH] = dini_Int(CommandFile, "Givehealth"); gCommands[GIVEWEAPON] = dini_Int(CommandFile, "Giveweapon"); gCommands[GOD] = dini_Int(CommandFile, "God"); gCommands[HEALALL] = dini_Int(CommandFile, "Healall"); gCommands[iMITATE] = dini_Int(CommandFile, "Imitate"); gCommands[iP] = dini_Int(CommandFile, "Ip"); gCommands[KICK] = dini_Int(CommandFile, "Kick"); gCommands[MAXAMMO] = dini_Int(CommandFile, "Maxammo"); gCommands[sETLEVEL] = dini_Int(CommandFile, "Setlevel"); gCommands[sETWANTED] = dini_Int(CommandFile, "Setwanted"); gCommands[TBAN] = dini_Int(CommandFile, "Tban"); gCommands[TIME] = dini_Int(CommandFile, "Time"); gCommands[WEATHER] = dini_Int(CommandFile, "Weather"); return 1; } #endif //----------------------------=<[Enums]>=--------------------------------------- enum PLAYER_MAIN_INFO { P_NAME[MAX_PLAYER_NAME], P_IP, P_REGGED, P_PASS, P_LOGGED, P_LEVEL, P_WIRED, P_JAILED } new GlobalPlayerInfo[MAX_PLAYERS][PLAYER_MAIN_INFO]; /*enum SETTINGS_MAIN { POCKET_MONEY, JAIL_COMMANDS, ANNOUNCE_SECONDS, PASS_MIN, PASS_MAX } new gSettings[sETTINGS_MAIN]; enum COMMANDS_MAIN { AKILL, ANNOUNCE, ARMOURALL, BAN, CARHP, EXPLODE, FLIP, GOTO, GETHERE, GIVEARMOUR, GIVEHEALTH, GIVEWEAPON, GOD, HEALALL, IMITATE, IP, KICK, MAXAMMO, PING, SETLEVEL, SETWANTED, TBAN, TIME, WEATHER } new gCommands[COMMANDS_MAIN]; */ //----------------------------=<[Global {new}]>=-------------------------------- //----------------------------=<[OnPlayerConnect]>=----------------------------- public OnPlayerConnect(playerid) { new file[100],Name[MAX_PLAYER_NAME],Ip[16]; GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name); if(!dini_Exists(file)) { dini_Create(file); dini_Set(file,"Name",Name); dini_Set(file,"Ip",Ip); dini_IntSet(file,"Registered",-1); dini_IntSet(file,"Password",0); dini_IntSet(file,"Level",0); dini_IntSet(file,"Wired",0); dini_IntSet(file,"Jailed",0); SendClientMessage(playerid,COLOUR_ORANGE,"Se pare ca esti nou pe server! Foloseste /register <password>"); } strcat(GlobalPlayerInfo[playerid][P_NAME], dini_Get(file,"Name")); strcat(GlobalPlayerInfo[playerid][P_IP], dini_Get(file,"Ip")); GlobalPlayerInfo[playerid][P_REGGED] = dini_Int(file,"Registered"); GlobalPlayerInfo[playerid][P_PASS] = dini_Int(file,"Password"); GlobalPlayerInfo[playerid][P_LEVEL] = dini_Int(file,"Level"); GlobalPlayerInfo[playerid][P_WIRED] = dini_Int(file,"Wired"); GlobalPlayerInfo[playerid][P_JAILED] = dini_Int(file,"Jailed"); if(GlobalPlayerInfo[playerid][P_REGGED] == 0) SendClientMessage(playerid,COLOUR_ORANGE,"Tu nu te-ai inregistrat inca! Foloseste /register <password>"); else if(GlobalPlayerInfo[playerid][P_REGGED] == 1) SendClientMessage(playerid,COLOUR_ORANGE,"Tu esti in inregistrat in baza de date. Foloseste /login <password>"); GlobalPlayerInfo[playerid][P_REGGED] = 0; return 1; } //----------------------------=<[OnPlayerDisconect]>=--------------------------- public OnPlayerDisconnect(playerid, reason) { new file[100]; format(file,sizeof(file),PlayerFile,GlobalPlayerInfo[playerid][P_NAME]); dini_Set(file,"Name",GlobalPlayerInfo[playerid][P_NAME]); dini_Set(file,"Ip",GlobalPlayerInfo[playerid][P_IP]); dini_IntSet(file,"Registered",GlobalPlayerInfo[playerid][P_REGGED]); dini_IntSet(file,"Password",GlobalPlayerInfo[playerid][P_PASS]); dini_IntSet(file,"Level",GlobalPlayerInfo[playerid][P_LEVEL]); dini_IntSet(file,"Wired",GlobalPlayerInfo[playerid][P_WIRED]); dini_IntSet(file,"Jailed",GlobalPlayerInfo[playerid][P_JAILED]); GlobalPlayerInfo[playerid][P_NAME] = 0; GlobalPlayerInfo[playerid][P_IP] = 0; GlobalPlayerInfo[playerid][P_REGGED] = 0; GlobalPlayerInfo[playerid][P_LOGGED] = 0; GlobalPlayerInfo[playerid][P_PASS] = 0; GlobalPlayerInfo[playerid][P_LEVEL] = 0; GlobalPlayerInfo[playerid][P_WIRED] = 0; GlobalPlayerInfo[playerid][P_JAILED] = 0; return 1; } //----------------------------=<[OnFilterScriptExit]>=-------------------------- //----------------------------=<[OnDialogResponse]>=---------------------------- //----------------------------=<[OnPlayerCommandText]>=------------------------- public OnPlayerCommandText(playerid, cmdtext[]) { new idx; new tmp[256]; new id; dcmd(register, 8, cmdtext); dcmd(login, 5, cmdtext); dcmd(password, 8, cmdtext); dcmd(help, 4, cmdtext); dcmd(announce, 8, cmdtext); if(strcmp(cmdtext, "/ban", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); id = ReturnUser(tmp); if(GlobalPlayerInfo[playerid][P_LEVEL] < gCommands[bAN]) { new string[256]; format(string, sizeof(string), "Esti admin %d? Nu deci, stai la locu tau!", gCommands[bAN]); return SendClientMessage(playerid, COLOUR_ORANGE, string); } if(IsPlayerConnected(id) && id != playerid) { new string[256]; format(string, sizeof(string), "%s a primit ban!", GlobalPlayerInfo[id][P_NAME]); SendClientMessageToAll(COLOUR_ORANGE, string); Ban(id); } else return SendClientMessage(playerid, COLOUR_ORANGE, "Nu iti poti da ban tie sau la un player care nu ii pe server!"); } return 1; } if(strcmp(cmdtext, "/kick", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); id = ReturnUser(tmp); if(GlobalPlayerInfo[playerid][P_LEVEL] < gCommands[KICK]) { new string[256]; format(string, sizeof(string), "Esti admin %d? Nu deci, stai la locu tau!", gCommands[KICK]); return SendClientMessage(playerid, COLOUR_ORANGE, string); } if(IsPlayerConnected(id) && id != playerid) { new string[256]; format(string, sizeof(string), "%s a primit kick!", GlobalPlayerInfo[id][P_NAME]); SendClientMessageToAll(COLOUR_ORANGE, string); Ban(id); } else { SendClientMessage(playerid, COLOUR_ORANGE, "Nu iti poti da kick tie sau la un player care nu ii pe server!"); } } return 1; } if(strcmp(cmdtext, "/kill", true) == 0) { tmp = strtok(cmdtext, idx); id = ReturnUser(tmp); if(GlobalPlayerInfo[playerid][P_LEVEL] < gCommands[AKILL]) { new string[256]; format(string, sizeof(string), "Ai admin level %d? Nu deci stai la locul tau!", gCommands[AKILL]); return SendClientMessage(playerid, COLOUR_ORANGE, string); } else if(!strlen(tmp)) { SendClientMessage(playerid, COLOUR_ORANGE, "[{FF0000}FOLOSIRE{FFFFFF}]: {00FF15}/kill {0000FF}[id | name]"); } else { if(IsPlayerConnected(id) && id != playerid) { SetPlayerHealth(id, 0.0); new string[256]; format(string, sizeof(string), "$s ti-a dat headshot de la 5 km distanta!.", GlobalPlayerInfo[playerid][P_NAME]); SendClientMessage(id, COLOUR_ORANGE, string); format(string, sizeof(string), "L-ai omorat pe %s.", GlobalPlayerInfo[id][P_NAME]); return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string); } else { SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Nu poti omora un player care nu este pe server."); } } } return 0; } dcmd_register(playerid, params[]) { if(GlobalPlayerInfo[playerid][P_REGGED] == 1) return SendClientMessage(playerid, COLOUR_ORANGE, "[{FF0000}ERROR{FFFFFF}]: You have already registered!"); else if(!params[0]) return SendClientMessage(playerid, COLOUR_ORANGE, "[{FF0000}FOLOSIRE{FFFFFF}]: /register [password]"); else if(strlen(params) < gSettings[PASS_MIN] || strlen(params) > gSettings[PASS_MAX]) { new string[128]; format(string, sizeof(string), "ERROR: Password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]); return SendClientMessage(playerid, COLOUR_ORANGE, string); } else { new password = num_hash(params); GlobalPlayerInfo[playerid][P_PASS] = password; GlobalPlayerInfo[playerid][P_REGGED] = 1; GlobalPlayerInfo[playerid][P_LOGGED] = 1; GetPlayerIp(playerid, GlobalPlayerInfo[playerid][P_IP], 16); new string[128]; format(string, sizeof(string), "Te-ai inregistrat in baza de date cu success folosing parola | {FF0000}%s {FFFFFF}|. Ai fost logat automat!", params); return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string); } } dcmd_login(playerid, params[]) { if(GlobalPlayerInfo[playerid][P_REGGED] != 1) return SendClientMessage(playerid, COLOUR_ORANGE, "[{FF0000}[EROARE{FFFFFF}]: Tu nu esti inregistrat!"); else if(GlobalPlayerInfo[playerid][P_LOGGED] == 1) return SendClientMessage(playerid, COLOUR_ORANGE, "[{FF0000}[EROARE{FFFFFF}]: Tu esti deja logat!"); else if(!params[0]) return SendClientMessage(playerid, COLOUR_ORANGE, "[{FF0000}FOLOSIRE{0000FF}]: /login {00FF00}[password]"); else { new password = num_hash(params); if(GlobalPlayerInfo[playerid][P_PASS] == password) { GlobalPlayerInfo[playerid][P_LOGGED] = 1; GetPlayerIp(playerid, GlobalPlayerInfo[playerid][P_IP], 16); return SendClientMessage(playerid, COLOUR_LIGHTBLUE, "Te-ai conectat cu success!"); } else return SendClientMessage(playerid, COLOUR_ORANGE, PASS_FAIL); } } dcmd_password(playerid, params[]) { if(GlobalPlayerInfo[playerid][P_REGGED] != 1) return SendClientMessage(playerid, COLOUR_ORANGE, "[{FF0000}[EROARE{FFFFFF}]: Tu nu esti inregistrat!"); else if(GlobalPlayerInfo[playerid][P_LOGGED] == 0) return SendClientMessage(playerid, COLOUR_ORANGE, "[{FF0000}[EROARE{FFFFFF}]: Tu esti deja logat!"); else { new tmp[256], tmp2[256], index; tmp = strtok(params, index); if(!strlen(tmp)) return SendClientMessage(playerid, COLOUR_ORANGE, "[{FF0000}FOLOSIRE{0000FF}]: /password [password] [new password]"); tmp2 = strtok(params, index); if(!strlen(tmp2)) return SendClientMessage(playerid, COLOUR_ORANGE, "[{FF0000}FOLOSIRE{0000FF}]: /password [password] [new password]"); new oldpassword = num_hash(tmp), newpassword = num_hash(tmp2); if(GlobalPlayerInfo[playerid][P_PASS] == oldpassword) { if(oldpassword == newpassword) return SendClientMessage(playerid, COLOUR_ORANGE, "[{FF0000}[EROARE{FFFFFF}]: Noua parola nu poate fi egala cu parola veche intelegi?."); else if(strlen(tmp2) < gSettings[PASS_MIN] || strlen(tmp2) > gSettings[PASS_MAX]) { new string[100]; format(string, sizeof(string), "ERROR: Your new password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]); return SendClientMessage(playerid, COLOUR_ORANGE, string); } GlobalPlayerInfo[playerid][P_PASS] = newpassword; new string[128]; format(string, sizeof(string), "Ti-ai schimbat cu success parola din \'%s\' to \'%s\'.", tmp, tmp2); return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string); } else return SendClientMessage(playerid, COLOUR_ORANGE, "[{FF0000}[EROARE{FFFFFF}]: Parola gresita!"); } } dcmd_help(playerid, params[]) { #pragma unused params SendClientMessage(playerid, COLOUR_ORANGE, "{FF0000}|**| {0000FF}CONT: {FFFFFF}/register {00FF00}* {FFFFFF}/login {00FF00}* {FFFFFF}/password {FF0000}|**|"); if(GlobalPlayerInfo[playerid][P_LEVEL] >= 1) { SendClientMessage(playerid, COLOUR_ORANGE, "{FF0000}|**| {0000FF}ADMIN: {FFFFFF}/ban {00FF00}*{FFFFFF}/kill {00FF00}*{FFFFFF}/announce {00FF00}*{FFFFFF}/kick {FF0000}|**|"); } return 1; } /*dcmd_kill(playerid, params[]) { new tmp[256]; tmp = strtok(cmdtext, idx); id = ReturnUser(tmp); if(GlobalPlayerInfo[playerid][P_LEVEL] < gCommands[AKILL]) { new string[100]; format(string, sizeof(string), "Ai admin level %d? Nu deci stai la locul tau!", gCommands[AKILL]); return SendClientMessage(playerid, COLOUR_ORANGE, string); } else if(!strlen(params)) return SendClientMessage(playerid, COLOUR_ORANGE, "[{FF0000}FOLOSIRE{FFFFFF}]: {00FF15}/kill {0000FF}[id | name]"); else { if(IsPlayerConnected(id) && id != playerid) { SetPlayerHealth(id, 0.0); new string[128]; format(string, sizeof(string), "$s ti-a dat headshot de la 5 km distanta!.", GlobalPlayerInfo[playerid][P_NAME]); SendClientMessage(id, COLOUR_ORANGE, string); format(string, sizeof(string), "L-ai omorat pe %s.", GlobalPlayerInfo[id][P_NAME]); return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string); } else return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Nu poti omora un player care nu ii pe server."); } }*/ dcmd_announce(playerid, params[]) { if(GlobalPlayerInfo[playerid][P_LEVEL] < gCommands[ANNOUNCE]) { new string[100]; format(string, sizeof(string), "Esti admin %d? Nu, deci stai la locul tau!", gCommands[ANNOUNCE]); return SendClientMessage(playerid, COLOUR_ORANGE, string); } else if(!strlen(params)) return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /announce [message]"); else return GameTextForAll(params, gSettings[ANNOUNCE_SECONDS] * 1000, 3); } /*dcmd_ban(playerid, params[]) { new tmp[256]; tmp = strtok(cmdtext, idx); id = ReturnUser(tmp); if(GlobalPlayerInfo[playerid][P_LEVEL] < gCommands[bAN]) { new string[100]; format(string, sizeof(string), "Esti admin %d? Nu deci, stai la locu tau!", gCommands[bAN]); return SendClientMessage(playerid, COLOUR_ORANGE, string); } if(IsPlayerConnected(id) && id != playerid) { new string[100]; format(string, sizeof(string), "%s a primit ban!", GlobalPlayerInfo[id][P_NAME]); SendClientMessageToAll(COLOUR_ORANGE, string); Ban(id); } else return SendClientMessage(playerid, COLOUR_ORANGE, "Nu iti poti da ban tie sau la un player care nu ii pe server!"); } dcmd_kick(playerid, params[]) { new tmp[256]; tmp = strtok(cmdtext, idx); id = ReturnUser(tmp); if(GlobalPlayerInfo[playerid][P_LEVEL] < gCommands[KICK]) { new string[100]; format(string, sizeof(string), "Esti admin %d? Nu deci, stai la locu tau!", gCommands[KICK]); return SendClientMessage(playerid, COLOUR_ORANGE, string); } if(IsPlayerConnected(id) && id != playerid) { new string[100]; format(string, sizeof(string), "%s a primit kick!", GlobalPlayerInfo[id][P_NAME]); SendClientMessageToAll(COLOUR_ORANGE, string); Ban(id); } else return SendClientMessage(playerid, COLOUR_ORANGE, "Nu iti poti da kick tie sau la un player care nu ii pe server!"); }*/ stock ReturnUser(text[], playerid = INVALID_PLAYER_ID) { new pos = 0; while (text[pos] < 0x21) // Strip out leading spaces { if (text[pos] == 0) return INVALID_PLAYER_ID; // No passed text pos++; } new userid = INVALID_PLAYER_ID; if (IsNumeric(text[pos])) // Check whole passed string { // If they have a numeric name you have a problem (although names are checked on id failure) userid = strval(text[pos]); if (userid >=0 && userid < MAX_PLAYERS) { if(!IsPlayerConnected(userid)) { userid = INVALID_PLAYER_ID; } else { return userid; // A player was found } } } // They entered [part of] a name or the id search failed (check names just incase) new len = strlen(text[pos]); new count = 0; new name[MAX_PLAYER_NAME]; for (new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { GetPlayerName(i, name, sizeof (name)); if (strcmp(name, text[pos], true, len) == 0) // Check segment of name { if (len == strlen(name)) // Exact match { return i; // Return the exact player on an exact match } else // Partial match { count++; userid = i; } } } } if (count != 1) { if (playerid != INVALID_PLAYER_ID) { if (count) { SendClientMessage(playerid, 0xFF0000AA, "Multiple users found, please narrow search."); } else { SendClientMessage(playerid, 0xFF0000AA, "No matching user found."); } } userid = INVALID_PLAYER_ID; } return userid; // INVALID_PLAYER_ID for bad return } IsNumeric(const string[]) { for (new i = 0, j = strlen(string); i < j; i++) { if (string > '9' || string < '0') return 0; } return 1; }[/pawn] Ai incercat sa il rezolvi singur?: Da
  4. Am rezolvat, inainte am incercat alte metode, iar acum m-am gandit sa schimb din 30 in 256 :)
  5. Nick: Klaudiu01 Problema: Problema Compiling Erori / warnings: [pawn]C:\DOCUME~1\Klaudiu\Desktop\Stuff\PAWNOL~1\admin.pwn(176) : error 047: array sizes do not match, or destination array is too small C:\DOCUME~1\Klaudiu\Desktop\Stuff\PAWNOL~1\admin.pwn(179) : error 047: array sizes do not match, or destination array is too small Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors. [/pawn] Lini/script: Script inceput de mine, linia 176 si 179: [pawn] new tmp[30], tmp2[30], index; tmp = strtok(params, index); if(!strlen(tmp)) return SendClientMessage(playerid, COLOUR_ORANGE, "[{FF0000}FOLOSIRE{0000FF}]: /password [password] [new password]"); tmp2 = strtok(params, index);[/pawn] Ai incercat sa rezolvi singur ?: Da, am incercat.
×
×
  • 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.