Jump to content
  • 0

Comanda /dmv


Guest Jo1Nt

Question

//----------------------------------[DMV TP]------------------------------------------------
	if(!strcmp(cmdtext,"/dmv",true))
	{
		if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pModerator] >= 1)
		{
			SetPlayerPos(playerid,1742.2769,-1861.6323,13.5773);
			return 1;
		}
	}

Dar nu stiu sa fac /dmv [playerid]

P.S: daca dau /dmv ma teleporteaza pe mine

Eu vreau sa folosesc /dmv [playerid]

Solutii?Mersi

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
  • Similar Content

    • By Rochester
      Salut Samp.Ro, astazi am decis sa va prezint o creatie simplu de facut zic eu, pe care am creato in  aceasta seara din plictiseala .
      Va rog nu fi-ti duri este primul meu FilterScript.
      Descriere:
      Un mapping destul de frumos zic eu, langa 'Los Santos International'. Va duceti frumos la DMV si scrieti /examen. Tastand aceasta comanda se creeaza un vehicul si va pune in el. Apoi urmeaza checkpoint-urile ,pe care voi trebuie sa le urmati. Cand un player paraseste/bubuie vehiculu acesta dispare. La fel si cand paraseste serverul, Nimeni nu-l poate da afara din vehicul  pe cel care este in cursul examenului, vehiculul se inchuie automat. Se creeaza cate vehicule este nevoie pot tine examenul si 10 playeri  odata. Download:
      http://pastebin.com/u4TVzL9G http://www.girlshare.ro/35157938.2 Poze:
       
       
      Credite:
      Rochester
    • By CristianLMAO
      Salut!
      Codul:
      #include <a_samp> #include <dini> #include <dudb> #include <zcmd> #pragma unused ret_memcpy //colors #define COLOR_GREY 0xAFAFAFAA #define COLOR_GREEN 0x33AA33AA #define COLOR_ORANGE 0xFF9900AA #define COLOR_RED 0xAA3333AA #define COLOR_YELLOW 0xFFFF00AA #define SERVER_USER_FILE "database/users/%s.ini" // users #define SERVER_ALOG_FILE "database/log/adminlogs.txt" // alogs #define gmtext "gold.united-islands.ro | v0.2" #define function%0(%1) forward %0(%1); public %0(%1) main() { } public OnGameModeInit() { SetGameModeText(gmtext); AddPlayerClass(0,1219,-1813.5,16.5,179.5,0,0,0,0,0,0); //spawn bikes CreateVehicle(510, 1237,-1813.2892,13.4315,270, 0, 0, 60); CreateVehicle(510, 1237,-1815.0358,13.4282,270, 0, 0, 60); CreateVehicle(510, 1237,-1816.5765,13.4258,270, 0, 0, 60); CreateVehicle(510, 1237,-1817.9580,13.4233,270, 0, 0, 60); CreateVehicle(510, 1237,-1819.4449,13.4225,270, 0, 0, 60); CreateVehicle(510, 1237,-1820.9550,13.4193,270, 0, 0, 60); CreateVehicle(510, 1237,-1822.3446,13.4148,270, 0, 0, 60); CreateVehicle(510, 1237,-1823.8909,13.4133,270, 0, 0, 60); // pickups CreatePickup(1581, 1, 1214.0170,-1814.4308,16.8, -1); //3d texts Create3DTextLabel("DMV\nScrie '/startexam' pentru a intra in examen! Acest examen costa 500k bani!", 0x00FF00BB, 1214.0170,-1814.4308,16.5, 40, 0, 1); return 1; } public OnGameModeExit(){ } enum pInfo { pCash, pBank, pAdminLevel, pBonusPoints, pScore, pPremium, pMuted, pInDmv, pDmvStage, pCarLic, pBanned } new PlayerInfo[MAX_PLAYERS][pInfo]; new gPlayerLogged[MAX_PLAYERS]; public OnPlayerConnect(playerid) { gPlayerLogged[playerid] = 0; new name[MAX_PLAYER_NAME], file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if (!dini_Exists(file)) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Register", "Scrie mai jos parola pe care vrei sa o ai la cont:", "Register", "inchide"); } if(fexist(file)) { ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "Login", "Punte-ti parola mai jos:", "Login", "Leave"); } return 1; } public OnPlayerDisconnect(playerid, reason) { new name[MAX_PLAYER_NAME], file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(gPlayerLogged[playerid] == 1) { dini_IntSet(file, "Cash", PlayerInfo[playerid][pCash]); dini_IntSet(file, "Bank", PlayerInfo[playerid][pBank]); dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]); dini_IntSet(file, "BonusPoints", PlayerInfo[playerid][pBonusPoints]); dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]); dini_IntSet(file, "Premium",PlayerInfo[playerid][pPremium]); dini_IntSet(file, "Muted",PlayerInfo[playerid][pMuted]); dini_IntSet(file, "InDMV",PlayerInfo[playerid][pInDmv]); dini_IntSet(file, "DmvStage",PlayerInfo[playerid][pDmvStage]); dini_IntSet(file, "Carlic",PlayerInfo[playerid][pCarLic]); dini_IntSet(file, "Banned",PlayerInfo[playerid][pBanned]); } gPlayerLogged[playerid] = 0; return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == 1) { new name[MAX_PLAYER_NAME], file[256], string[128]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(!response) return Kick(playerid); if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Register", "Scrie mai jos parola pe care vrei sa o ai la cont:", "Register", "inchide"); dini_Create(file); dini_IntSet(file, "Cash", PlayerInfo[playerid][pCash] = 1000000); dini_IntSet(file, "Bank", PlayerInfo[playerid][pBank] = 5000); dini_IntSet(file, "Password", udb_hash(inputtext)); dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel] = 0); dini_IntSet(file, "BonusPoints",PlayerInfo[playerid][pBonusPoints] = 0); dini_IntSet(file, "Score",PlayerInfo[playerid][pScore] = 1); dini_IntSet(file, "Premium",PlayerInfo[playerid][pPremium] = 0); dini_IntSet(file, "Muted",PlayerInfo[playerid][pMuted]); dini_IntSet(file, "InDMV",PlayerInfo[playerid][pInDmv] = 1); dini_IntSet(file, "DmvStage",PlayerInfo[playerid][pDmvStage] = 0); dini_IntSet(file, "Carlic",PlayerInfo[playerid][pCarLic]); dini_IntSet(file, "Banned",PlayerInfo[playerid][pBanned]); format(string, 128, "[SYSTEM]: succes registrat numele asta %s, ai intrat autologin.", name); SendClientMessage(playerid, COLOR_YELLOW, string); SpawnPlayer(playerid); gPlayerLogged[playerid] = 1; } if (dialogid == 2) { new name[MAX_PLAYER_NAME], file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(!response) return Kick(playerid); if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "Login", "Punte-ti parola mai jos:", "Login", "Leave"); new tmp; tmp = dini_Int(file, "Password"); if(udb_hash(inputtext) != tmp) { SendClientMessage(playerid, COLOR_RED, "[SYSTEM] Parola gresita!"); ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "Login", "Punte-ti parola mai jos:", "Login", "Leave"); } else { SpawnPlayer(playerid); gPlayerLogged[playerid] = 1; PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel"); SetPlayerScore(playerid, PlayerInfo[playerid][pScore]); GivePlayerMoney(playerid, dini_Int(file, "Cash")-GetPlayerMoney(playerid)); SendClientMessage(playerid,COLOR_GREEN, "[SYSTEM]: Te-ai logat!"); } } return 1; } public OnPlayerStateChange(playerid, newstate, oldstate){ return 1; } public OnPlayerText(playerid, text[]){ new name[MAX_PLAYER_NAME]; new file[256]; new string[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(dini_Int(file, "Muted") == 1){ format(string, sizeof(string), "You can't talk right now! You are muted."); SendClientMessage(playerid, COLOR_GREY, string); return 0; } else{ return 1; } } public OnPlayerSpawn(playerid) { new name[MAX_PLAYER_NAME]; new file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(dini_Int(file, "InDmv") == 1) { SendClientMessage(playerid, COLOR_GREEN, "Ai picat testul deoarece ai iesit de pe server!"); dini_IntSet(file, "InDmv", PlayerInfo[playerid][pInDmv] = 0); } return 1; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { new name[MAX_PLAYER_NAME]; new file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(ispassenger == 0){ if(dini_Int(file, "Carlic") == 0) { SendClientMessage(playerid, COLOR_GREY, "* Nu ai permis de conducere! Scrie /dmv pentru a incepe un curs de conducere"); SlapPlayer(playerid); } } return 1; } public OnPlayerExitVehicle(playerid, vehicleid){ new name[MAX_PLAYER_NAME]; new file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(dini_Int(file, "InDmv") == 1){ DestroyVehicle(vehicleid); dini_IntSet(file, "InDmv", PlayerInfo[playerid][pInDmv] = 0); SendClientMessage(playerid, COLOR_RED, "Deoarece ai iesit din masina testului, ai picat examenul"); } return 1; } public OnPlayerCommandText(playerid, cmdtext[]){ return 0; } stock GetName(playerid){ new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, MAX_PLAYER_NAME); return playername; } public OnPlayerEnterCheckpoint(playerid){ new name[MAX_PLAYER_NAME]; new file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(dini_Int(file, "DmvStage") == 1){ SetPlayerCheckpoint(playerid, 1311.3917,-1840.5356,12.9904, 10); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 2); } if(dini_Int(file, "DmvStage") == 2){ SetPlayerCheckpoint(playerid, 1326.6887,-1734.6566,12.9904, 10); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 3); } if(dini_Int(file, "DmvStage") == 3){ SetPlayerCheckpoint(playerid, 1526.7543,-1735.5416,12.9904, 10); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 4); } if(dini_Int(file, "DmvStage") == 4){ SetPlayerCheckpoint(playerid, 1526.1432,-1590.6320,12.9904, 10); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 5); } if(dini_Int(file, "DmvStage") == 5){ SetPlayerCheckpoint(playerid, 1406.6301,-1590.2607,12.9650, 10); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 6); } if(dini_Int(file, "DmvStage") == 6){ SetPlayerCheckpoint(playerid, 1314.1741,-1563.0592,12.9904, 10); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 7); } if(dini_Int(file, "DmvStage") == 7){ SetPlayerCheckpoint(playerid, 1359.6761,-1422.0052,12.9904, 10); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 8); } if(dini_Int(file, "DmvStage") == 8){ SetPlayerCheckpoint(playerid, 1278.8462,-1394.5029,12.7273, 10); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 9); } if(dini_Int(file, "DmvStage") == 9){ SetPlayerCheckpoint(playerid, 1208.9016,-1385.4451,12.8471, 10); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 10); } if(dini_Int(file, "DmvStage") == 10){ SetPlayerCheckpoint(playerid, 1216.1479,-1284.8210,12.9904, 10); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 11); } if(dini_Int(file, "DmvStage") == 11){ SetPlayerCheckpoint(playerid, 1310.4785,-1281.9036,12.9904, 10); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 12); } if(dini_Int(file, "DmvStage") == 12){ SetPlayerCheckpoint(playerid, 1313.7811,-1540.7218,12.9961, 10); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 13); } if(dini_Int(file, "DmvStage") == 13){ SetPlayerCheckpoint(playerid, 1309.2744,-1822.3461,12.9904, 10); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 14); } if(dini_Int(file, "DmvStage") == 14){ SetPlayerCheckpoint(playerid, 1272.6282,-1847.5135,12.9977, 10); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 15); } if(dini_Int(file, "DmvStage") == 15){ SetPlayerCheckpoint(playerid, 1271.3938,-1827.1415,12.9922, 10); dini_IntSet(file, "DmvStage", 16); } if(dini_Int(file, "DmvStage") == 16){ DisablePlayerCheckpoint(playerid); dini_IntSet(file, "DmvStage", 0); dini_IntSet(file, "InDMV", 0); dini_IntSet(file, "Carlic", 1); DestroyVehicle(GetPlayerVehicleID(playerid)); } return 0; } //comenzi: CMD:startexam(playerid, params){ new name[MAX_PLAYER_NAME]; new file[256]; new car[1]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(dini_Int(file, "Carlic") == 1) return SendClientMessage(playerid, COLOR_RED, "Deja ai licenta pentru masina!"); if(dini_Int(file, "InDMV") == 1) return SendClientMessage(playerid, COLOR_RED, "Deja esti in examen, daca crezi ca este o problema, poti sa reintri pe server!"); if(dini_Int(file, "Cash") < 500000) return SendClientMessage(playerid, COLOR_RED, "Nu ai suficienti bani pentru a face acest lucru!"); DisablePlayerCheckpoint(playerid); dini_IntSet(file, "Cash", PlayerInfo[playerid][pCash] =dini_Int(file, "Cash")-500000); dini_IntSet(file, "InDMV", PlayerInfo[playerid][pInDmv] = 1); GivePlayerMoney(playerid, dini_Int(file, "Cash")-GetPlayerMoney(playerid)); dini_IntSet(file, "CarLic", PlayerInfo[playerid][pCarLic] = 0); car[0] = CreateVehicle(421, 1267.9502,-1825.6804,13.3818,185.7668, 1, 1, 90000000); PutPlayerInVehicle(playerid, car[0], 0); SetPlayerCheckpoint(playerid, 1269.2395,-1846.8804,13.0048, 10); SendClientMessage(playerid, COLOR_GREEN, "Du-te la checkpoint-uri!"); dini_IntSet(file, "DmvStage", PlayerInfo[playerid][pDmvStage] = 1); return 1; } Cand compilez, nu se intampla nimic, dar in joc, cand intru in checkpoint imi activeaza toate checkpointurile
      Stiu ce am facut gresit, dar nu stiu sa rezolv. 
      Check-pointurile sunt la OnPlayerEnterCheckpoint.
       
      Multumesc!
    • By xLinix96
      Salut, asta este prima mea postare pe aceasta comunitate, astazi vreau sa va arat cum sa creati o comanda /flymode, stiu ca este o comanda foarte simpla, dar sunt unii incepatori care nu stiu sa o faca.
       
      Pentru inceput aveti nevoie de un include.
      #include <fly>
      Il gasiti aici: http://www.solidfiles.com/d/289d6c8fdf/
       
       
      Acum vom face comanda:
      CMD:fly(playerid, params[])
      {
          if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te comenctezi."); // aici verificam daca esti conectat
          if(IsPlayerConnected(playerid)) 
          {
              if(PlayerInfo[playerid][pAdmin] >= 1) // aici punem nivelul de admin necesar pentru a folosii comanda.
              {
                  new sendername[30],string[256];
                  if(flymode[playerid] == 0)
                  {
                      GetPlayerName(playerid, sendername, sizeof(sendername)); // aici obtinem numele adminuui.
                      togfind[playerid] = 0;
                      flymode[playerid] = 1;
                      format(string,sizeof(string),"{DFF230}%s este acum in modul fly-mode.", sendername); 
                      ABroadCast(COLOR_ORANGE,string,1);
                      InitFly(playerid);
                      StartFly(playerid);
                      SetPlayerHealthEx(playerid, 10000000); // aici setam hp-ul.
                  }
                  else
                  {
                      GetPlayerName(playerid, sendername, sizeof(sendername)); // iar de aici oprim fly-ul.
                      togfind[playerid] = 1;
                      flymode[playerid] = 0;
                      format(string,sizeof(string),"{F89AD6}Ai oprit fly-mode-ul", sendername);
                      SCM(playerid, COLOR_GREEN, string);
                      StopFly(playerid);
                      SetPlayerHealthEx(playerid, 100); // 
                  }
              }
              else return SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
          }
          return 1;
      }
       
      Sper ca v-am ajutat, nu este cine site ce sistem.
       
       
    • By FlobertRO
      Cum pot schimba o comanda de tipul "strcmp" in "cmd" ? un exemplu daca se poate, multumesc <3
    • By TheGodfather
      Salut, aveti idee cum pot face o comanda prin care playerii sa se poata reconecta pe server fara sa inchida sampul? Gen sa dea /relog si sa le incarce din nou toate datele, sa puna din nou parola etc.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.