Jump to content

xRaul

Membru
  • Posts

    8
  • Joined

  • Last visited

    Never

Everything posted by xRaul

  1. Cum pot face ca imediat dupa login sa imi dea spawn... ? Inainte de a adauga in : OnPlayerRequestClass : nu uita de : forward Timer(playerid); : { SetTimer("Timer",1,false); return 1; } dupa care faci un callback: public Timer(playerid) { SpawnPlayer(playerid); SetPlayerPos(playerid, -2868.3137,471.6636,4.8773); SetPlayerSkin(playerid, 7); return 1; }
  2. xRaul

    Erroare stocks

    Aia e problema ca am pierdut folderul... e de la un sistem simplu de admin ..
  3. Tot primesc o erroare si nu stiu ce sa ii mai fac.... C:\DOCUME~1\Raul\Desktop\SA-MP_RP\FILTER~1\baseA.pwn(5) : fatal error 100: cannot read from file: "stocks" Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 1 Error. Am cautat fisierul stocks ... da nimic ..
  4. xRaul

    Bug aHouse

    Am gasit un bug in sistemul de case pe care il folosesc .. ma puteti ajuta sa il rezolv. "Apare de 2 ori OwnerBy: ForSale Price: OwnerBy: Price: " a 2-a oara nu mai scrie for sale ... Sistemul de case ...
  5. Buna ma puteti ajuta cu adaugarea factiunilor am nevoie doar de un exemplu.. dupa care ma descurc. //=====================INCLUDE #include <a_samp> //=====================PUBLIC main() { print("\n----------------------------------"); print(" Blank Gamemode by your name here"); print("----------------------------------\n"); } public OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("betaRP"); AddPlayerClass(7,1481.1349,-1751.4083,15.4453,0.8991,0,0,0,0,0,0); return 1; } public OnPlayerConnect(playerid) { SetPlayerMapIcon( playerid,1,1553.3160,-1675.7695,16.1953,30,0);// icon car return 1; }
  6. xRaul

    Factiuni

    Cum pot sa adaug factiuni in GM-ul acesta adica vreau doar una ca exemplu ... PD //=====================INCLUDE #include <a_samp> //=====================PUBLIC main() { print("\n----------------------------------"); print(" Blank Gamemode by your name here"); print("----------------------------------\n"); } public OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("betaRP"); AddPlayerClass(7,1481.1349,-1751.4083,15.4453,0.8991,0,0,0,0,0,0); return 1; } public OnPlayerConnect(playerid) { SetPlayerMapIcon( playerid,1,1553.3160,-1675.7695,16.1953,30,0);// icon car return 1; }
  7. Dap ceva de genu ....
  8. De vre-o 4 ore ma chinui sa il fac sa scrie AdminLevel am reusit pana la urma insa dupa ce ies din joc imi da in fisierul cu numele AdminLevel= ... #include <a_samp> #define GREEN 0x21DD00FF #define RED 0xE60000FF #define ADMIN_RED 0xFB0000FF #define YELLOW 0xFFFF00FF #define ORANGE 0xF97804FF #define LIGHTRED 0xFF8080FF #define LIGHTBLUE 0x00C2ECFF #define PURPLE 0xB360FDFF #define PLAYER_COLOR 0xFFFFFFFF #define BLUE 0x1229FAFF #define LIGHTGREEN 0x38FF06FF #define DARKPINK 0xE100E1FF #define DARKGREEN 0x008040FF #define ANNOUNCEMENT 0x6AF7E1FF #define COLOR_SYSTEM 0xEFEFF7AA #define GREY 0xCECECEFF #define PINK 0xD52DFFFF #define DARKGREY 0x626262FF #define AQUAGREEN 0x03D687FF #define NICESKY 0x99FFFFAA #define WHITE 0xFFFFFFFF #define ACCOUNTS_FOLDER "/%s.ini" #define LOGIN_DELAY 3 // Seconds. Default = 3 seconds enum aInfo { aPassword[128], aLogged, }; new AccountInfo[MAX_PLAYERS][aInfo]; new register[MAX_PLAYERS]; new login[MAX_PLAYERS]; forward LogIn(playerid); forward OnPlayerUpdate(playerid); /*x---------------------------------CallBacks-------------------------------------x*/ public OnGameModeInit() { AddPlayerClass(47,1477.3417,-1746.8785,14.6812,10.1765,0,0,0,0,0,0); return 1; } public OnPlayerConnect(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); new string[128]; format(string, sizeof(string), ACCOUNTS_FOLDER, name); if (AccountInfo[playerid][aLogged] == 0) { if (!fexist(string)) { new kayitmsg[256]; format(kayitmsg,256,"Bun venit\n\n%s inregistreazate.\n\nIntrodu parola.",name); ShowPlayerDialog(playerid,0,DIALOG_STYLE_INPUT,"RomaniaRP BETA",kayitmsg,"Register","Quit"); register[playerid] = 1; login[playerid] = 0; } else if (fexist(string)) { new girismsg[256]; format(girismsg,256,"Bun venit\n\n%s connecteazate. \n\n Introdu parola.",name); ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"RomaniaRP BETA",girismsg,"Login","Quit"); AddPlayerClass(47,1477.3417,-1746.8785,14.6812,10.1765,0,0,0,0,0,0); register[playerid] = 0; login[playerid] = 1; } } AccountInfo[playerid][aLogged] = 0; return 1; } public OnPlayerDisconnect(playerid, reason) { OnPlayerUpdate(playerid); AccountInfo[playerid][aLogged] = 0; register[playerid] = 0; login[playerid] = 0; return 1; } public OnPlayerSpawn(playerid) { GivePlayerMoney(playerid, 30000); GivePlayerWeapon(playerid,WEAPON_COLT45,100); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (response == 1) { if(dialogid == 0) { Encrypt(inputtext); new player[MAX_PLAYER_NAME]; GetPlayerName(playerid, player, 50); new string3[32]; new playername3[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername3, sizeof(playername3)); format(string3, sizeof(string3), ACCOUNTS_FOLDER, playername3); new ip[20]; GetPlayerIp(playerid,ip,sizeof(ip)); new File: hFile = fopen(string3, io_write); if (hFile) { strmid(AccountInfo[playerid][aPassword], inputtext, 0, strlen(inputtext), 255); new var[128], string[256], name[30]; format(var, 128, "Password=%s\n", AccountInfo[playerid][aPassword]);fwrite(hFile, var); format(var, 128, "IP=%s\n",ip);fwrite(hFile, var); fclose(hFile); printf("%s is signed up.",playername3); format(string,sizeof(string),"Bun venit %s . Distractie placuta!",name); SendClientMessage(playerid, GREEN, string); new girismsg[256]; format(girismsg,256,"Bun venit\n\n%s connecteazate. \n\n Introdu parola.",playername3); ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"RomaniaRP BETA",girismsg,"Login","Quit"); register[playerid] = 0; login[playerid] = 1; } } if(dialogid == 1) { Encrypt(inputtext); new string2[128]; new playername2[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername2, sizeof(playername2)); format(string2, sizeof(string2), ACCOUNTS_FOLDER, playername2); new File: UserFile = fopen(string2, io_read); if ( UserFile ) { new PassData[256]; new keytmp[256], valtmp[256]; fread( UserFile , PassData , sizeof( PassData ) ); keytmp = ini_GetKey( PassData ); if( strcmp( keytmp , "Password" , true ) == 0 ) { valtmp = ini_GetValue( PassData ); strmid(AccountInfo[playerid][aPassword], valtmp, 0, strlen(valtmp)-1, 255); } if(strcmp(AccountInfo[playerid][aPassword],inputtext, true ) == 0 ) { for(new p = 0; p < strlen(AccountInfo[playerid][aPassword]); p++) { inputtext[p] = '?'; } SetTimerEx("LogIn", LOGIN_DELAY*1000, 0, "d", playerid); printf("%s is logged in.",playername2); new name2[24], string12[256], key[256]; GetPlayerName(playerid,name2,24); format(string12,sizeof(string12),"Bun venit %s. Distractie placuta!",name2); SendClientMessage(playerid, GREEN, string12); new Data[256]; while ( fread( UserFile , Data , sizeof( Data ) ) ) { key = ini_GetKey( Data ); /*&if(strcmp(key, "AdminLevel", true) == 0) // This is only an example if you want to add more stuff to store in a file. { val = ini_GetValue( Data ); AccountInfo[playerid][AdminLevel] = strval(val); // Uncommenting this will give you errors if the variable isn't defined. }*/ } fclose(UserFile); } else { new girismsg[256]; printf("%s folosesti o parola gresita.",playername2); format(girismsg,256,"Ai introdus o parola gresita.\n\nDaca nu esti detinatorul acestui nume schimbal."); ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit"); login[playerid] = 1; register[playerid] = 0; fclose(UserFile); return 1; } } } if(dialogid == 2) { Encrypt(inputtext); new string2[128]; new playername2[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername2, sizeof(playername2)); format(string2, sizeof(string2), ACCOUNTS_FOLDER, playername2); new File: UserFile = fopen(string2, io_read); if ( UserFile ) { new PassData[256]; new keytmp[256], valtmp[256]; fread( UserFile , PassData , sizeof( PassData ) ); keytmp = ini_GetKey( PassData ); if( strcmp( keytmp , "Password" , true ) == 0 ) { valtmp = ini_GetValue( PassData ); strmid(AccountInfo[playerid][aPassword], valtmp, 0, strlen(valtmp)-1, 255); } if(strcmp(AccountInfo[playerid][aPassword],inputtext, true ) == 0 ) { for(new p = 0; p < strlen(AccountInfo[playerid][aPassword]); p++) { inputtext[p] = '?'; } SetTimerEx("LogIn", LOGIN_DELAY*1000, 0, "d", playerid); printf("%s is logged in.",playername2); new key[256]; new Data[256]; while ( fread( UserFile , Data , sizeof( Data ) ) ) { key = ini_GetKey( Data ); /*if(strcmp(key, "AdminLevel", true) == 0) // This is only an example if you want to add more stuff to store in a file. { val = ini_GetValue( Data ); AccountInfo[playerid][AdminLevel] = strval(val); // Uncommenting this will give you errors if the variable isn't defined. }*/ } fclose(UserFile); } else { new girismsg[256]; printf("%s folosesti o parola gresita.",playername2); format(girismsg,256,"Ai introdus o parola gresita.\n\nDaca nu esti detinatorul acestui nume schimbal."); ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"RomaniaRP BETA",girismsg,"Login","Quit"); login[playerid] = 1; register[playerid] = 0; fclose(UserFile); return 1; } } } } else return Kick(playerid); return 0; } public OnPlayerExitedMenu(playerid) { 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; } public LogIn(playerid) { AccountInfo[playerid][aLogged] = 1; register[playerid] = 0; login[playerid] = 0; return 1; } public OnPlayerUpdate(playerid) { if(IsPlayerConnected(playerid)) { if(AccountInfo[playerid][aLogged] == 1) { new string3[128]; new playername3[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername3, sizeof(playername3)); format(string3, sizeof(string3), ACCOUNTS_FOLDER, playername3); new ip[20]; GetPlayerIp(playerid,ip,sizeof(ip)); new File: hFile = fopen(string3, io_write); if (hFile) { new var[128]; format(var, 128, "Password=%s\n", AccountInfo[playerid][aPassword]);fwrite(hFile, var); format(var, 128, "IP=%s\n",ip);fwrite(hFile, var); fclose(hFile); } } } return 1; } Encrypt(string[]) { for(new x=0; x < strlen(string); x++) { string[x] += (3^x) * (x % 15); if(string[x] > (0xff)) { string[x] -= 256; } } }
×
×
  • 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.