Jump to content

Rayan

Membru
  • Posts

    198
  • Joined

  • Last visited

Posts posted by Rayan

  1. Cand jucatorul nu este pe un turf spune ca Comanda nu exista, insa in comanda e pusa ca daca jucatorul nu se afla pe niciun turf sa ii zica "You are not on a turf". insa inloc sa scrie asta, scrie ca SERVER: Unknown Command.

     

    Cine stie cum sa rezolv poate posta aici, multumesc!

     

    CMD:attack(playerid, params[])
    {
    	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
    	new hour,minn,sec,y,m,d;
    	gettime(hour,minn,sec);
    	getdate(y,m,d);
    	if(IsPlayerConnected(playerid))
    	{
    		if(!IsAMember(playerid)) return SCM(playerid,COLOR_WHITE,"You are not a member of a mafia.");
    		if(PlayerInfo[playerid][pRank] < 4) return SCM(playerid,COLOR_WHITE,"You don't have rank 4.");
    		if(m == 12 && d == 25 || m == 12 && d == 26) return SS(playerid, COLOR_WHITE, "Nu poti folosi aceasta comanda pe 25 sau 26 decembrie.", "You can't use this command on 25 or 26 december.");
    		if(m == 1 && d == 1 || m == 1 && d == 2) return SS(playerid, COLOR_WHITE, "Nu poti folosi aceasta comanda pe 1 sau pe 2 ianuarie.", "You can't use this command on 1 or 2 January.");
    		//if(GetWeekDay() == 1 || GetWeekDay() == 4 || GetWeekDay() == 6) return SS(playerid, COLOR_WHITE, "War-ul este permis doar Luni, Miercuri, Vineri si Duminica.", "You can use this command only Monday, Wednesday, Friday and Sunday.");
    		if(hour == 20 || hour == 21 || hour == 22 || hour == 23 || hour == 24)
    		{
    			new turf,faction,string[128],sendername[MAX_PLAYER_NAME];
    			for(new i = 1; i <= sizeof(TurfInfo); i++)
    			{
    				if(IsPlayerInTurf(playerid, i) == 1)
    				{
    					turf = i;
    					break;
    				}
        		}
        		GetPlayerName(playerid, sendername, sizeof(sendername));
        		if(turf == 0) return SCM(playerid, COLOR_WHITE, "You are not on a turf.");
    			if(DeelayWar[PlayerInfo[playerid][pMember]] > 0)
    			{
    				format(string,sizeof(string),"(War) {FFFFFF}Your mafia can attack another turf in %d seconds.",DeelayWar[PlayerInfo[playerid][pMember]]);
    				SendClientMessage(playerid, COLOR_GREEN, string);
    				return 1;
    			}
        		faction = PlayerInfo[playerid][pMember];
        		if(TurfInfo[turf][zOwned] == faction) return SCM(playerid, COLOR_WHITE, "You can't attack your own turf.");
    			if(WarInfo[turf][wAttacker] != 0) return SCM(playerid, COLOR_WHITE, "Turf is already attacked.");
    			if(InWar[faction] == 1) return SCM(playerid, COLOR_WHITE, "You have an active war.");
    			if(InWar[TurfInfo[turf][zOwned]] == 1) return SCM(playerid, COLOR_WHITE, "This mafia have active war.");
    			new memberss;
    			foreach(new i : Player)
    			{
    	    		if(IsPlayerConnected(i))
    	    		{
    	        		if(PlayerInfo[i][pMember] == TurfInfo[turf][zOwned])
    					{
    			    		memberss ++;
    					}
    				}
    			}
    			if(memberss < 1) return SCM(playerid, COLOR_WHITE, "This mafia don't have members online.");
    			WarInfo[turf][wTime] = 1200;
    			WarInfo[turf][wAttacker] = faction;
    			WarInfo[turf][wFaction] = TurfInfo[turf][zOwned];
    			format(string,sizeof(string),"[TURF] %s from your group attacked turf %d (owned by %s).",sendername,turf,NumeFactiune(TurfInfo[turf][zOwned]));
    			SendFamilyMessage(faction,COLOR_GREEN,string);
    			format(string,sizeof(string),"[TURF] %s from %s attacked turf %d owned by you.",sendername,NumeFactiune(WarInfo[turf][wAttacker]),turf);
    			SendFamilyMessage(TurfInfo[turf][zOwned],COLOR_GREEN,string);
    			new Cache: abs = mysql_query(SQL, "SELECT * FROM wars");
    			new warid = cache_get_row_count() + 1;
    			cache_delete(abs);
    			format(string, sizeof(string),"[WAR] %s started a war with %s (war id: %d).",NumeFactiune(WarInfo[turf][wAttacker]),NumeFactiune(TurfInfo[turf][zOwned]),warid);
    			ABroadCast(COLOR_ADMCOMMANDS,string,1);
    			foreach(new i : Player)
    			{
    				if(PlayerInfo[i][pMember] == TurfInfo[turf][zOwned] || PlayerInfo[i][pMember] == WarInfo[turf][wAttacker])
    				{
    					SetPlayerVirtualWorld(i, 1024);
    					SS(i, COLOR_YELLOW, "Ai fost teleportat intr-un Virtual World unde sunt prezenti doar jucatorii ce participa la war.", "You have been teleported to a virtual world where only players participating in the war are present.");
    				}
    			}
    			if(WarInfo[turf][wAttacker] == 4 || TurfInfo[turf][zOwned] == 4)
    			{
    				for(new x = 0; x < sizeof(VehicleInfo); x++)
    				{
    					if(VehicleInfo[x][vehGroup] == 4)
    					{
    						SetVehicleVirtualWorld(VehicleInfo[x][vehCarID], 1024);
    					}
    				}
    			}
    			if(WarInfo[turf][wAttacker] == 5 || TurfInfo[turf][zOwned] == 5)
    			{
    				for(new x = 0; x < sizeof(VehicleInfo); x++)
    				{
    					if(VehicleInfo[x][vehGroup] == 5)
    					{
    						SetVehicleVirtualWorld(VehicleInfo[x][vehCarID], 1024);
    					}
    				}
    			}
    			if(WarInfo[turf][wAttacker] == 6 || TurfInfo[turf][zOwned] == 6)
    			{
    				for(new x = 0; x < sizeof(VehicleInfo); x++)
    				{
    					if(VehicleInfo[x][vehGroup] == 6)
    					{
    						SetVehicleVirtualWorld(VehicleInfo[x][vehCarID], 1024);
    					}
    				}
    			}
    			if(WarInfo[turf][wAttacker] == 10 || TurfInfo[turf][zOwned] == 10)
    			{
    				for(new x = 0; x < sizeof(VehicleInfo); x++)
    				{
    					if(VehicleInfo[x][vehGroup] == 10)
    					{
    						SetVehicleVirtualWorld(VehicleInfo[x][vehCarID], 1024);
    					}
    				}
    			}
    			worstscoreat[turf] = 0;
    			worstmemberat[turf] = 999;
    			bestscoreat[turf] = 0;
    			bestmemberat[turf] = 999;
    			worstscoredf[turf] = 0;
    			worstmemberdf[turf] = 999;
    			bestscoredf[turf] = 0;
    			bestmemberdf[turf] = 999;
    			InWar[TurfInfo[turf][zOwned]] = 1;
    			InWar[faction] = 1;
    			waitwar[faction] = 60;
    		}
    		else return SS(playerid, COLOR_LIGHTGREEN3, "Poti folosi aceasta comanda doar intre orele 20:00 - 22:00.", "War must be between 20:00 and 22:00.");
    	}
    	return 1;
    }

     

  2. Salut, am o problema, la OnPlayerGiveDamage, am aceasta functie, practic mesajul este trimis, insa jucatorul tot i se ia HP

    public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
    {
        if(damagedid != INVALID_PLAYER_ID)
        {
          	if(PlayerInfo[damagedid][pFreezeTime] != 0)
            {
                SendClientMessage(playerid, -1, "This player is frozen, you can't shoot him.");
                amount = 0;
                return 0;
            }
        }
        return 1;
    }

    Cum as putea rezolva sa nu ia ia HP?

  3. Bump, am observat ca problema apare cand am SetPlayerTeam(playerid,255) la OnPlayerSpawn, am incercat sa o sterg, si la fel, OnPlayerDeath e chemat de 2 ori, dar daca pun de exemplu: SetPlayerTeam(playerid,4); OnPlayerDeath nu mai e chemat de 2 ori, insa jucatorii nu pot sa isi ia damage fie Heli blade, fie cu grenadele (explozii) etc..

    Stie cineva cum as putea rezolva?

    GM-ul wexgaming, un edit de la bigzone

  4. Acum 1 oră, WopsS a spus:

    Atunci pune la OnPlayerConnect aceeasi chestie.

    Am incercat, acum numai pune unlock la usile de la vehicul deloc, raman deschise...wtf

    Am pus asa in comanda /work

     foreach(new x : Player) {
                                if(x != playerid) SetVehicleParamsForPlayer(pJobVehicle[playerid], x, 0, 1);
                            }
                            SetVehicleParamsForPlayer(pJobVehicle[playerid],playerid, 0, 0);

    si in onplayerconnect

     foreach(new ids : Player) {
                                if(ids != playerid) SetVehicleParamsForPlayer(pJobVehicle[ids], playerid, 0, 1);
                            }
  5. Acum 10 minute, WopsS a spus:

    Asta înseamnă că nu poți să le folosești pe amândouă. Folosește doar SetVehicleParamsForPlayer, blochează vehiculul pentru toți jucătorii în afară de cel care muncește.

    Am incercat,

    foreach(new i : Player)
                            {
                                if(i != playerid) SetVehicleParamsEx(JobVehicle[playerid],engine,lights,alarm,1,bonnet,boot,objective);
                            }

    Insa problema e ca cauta jucatori in momentul acela, daca un jucator nou se conecteaza, lui nu ii se incuie masina pentru masina de job la playerid

  6. Acum 9 minute, WopsS a spus:

    Făi un debug la OnVehicleStreamIn.

    
    printf("%i | %i", vehicleid, JobVehicle[forplayerid]);

     

     

    ----------
    Loaded log file: "server_log.txt".
    ----------
    
    SA-MP Dedicated Server
    ----------------------
    v0.3.7-R2, (C)2005-2015 SA-MP Team
    
    [19:06:12] filterscripts = ""  (string)
    [19:06:12] 
    [19:06:12] Server Plugins
    [19:06:12] --------------
    [19:06:12]  Loading plugin: Whirlpool
    [19:06:12]  
    [19:06:12]  ==================
    [19:06:12]  
    [19:06:12]   Whirlpool loaded
    [19:06:12]  
    [19:06:12]  ==================
    [19:06:12]  
    [19:06:12]   Loaded.
    [19:06:12]  Loading plugin: mysql.dll
    [19:06:12]  >> plugin.mysql: R39-6 successfully loaded.
    [19:06:12]   Loaded.
    [19:06:12]  Loading plugin: sscanf.dll
    [19:06:12] 
    
    [19:06:12]  ===============================
    
    [19:06:12]       sscanf plugin loaded.     
    
    [19:06:12]          Version:  2.8.1        
    
    [19:06:12]    (c) 2012 Alex "Y_Less" Cole  
    
    [19:06:12]  ===============================
    
    [19:06:12]   Loaded.
    [19:06:12]  Loading plugin: crashdetect.dll
    [19:06:12]   CrashDetect v4.15.1 is OK.
    [19:06:12]   Loaded.
    [19:06:12]  Loading plugin: streamer.dll
    [19:06:12] 
    
    *** Streamer Plugin v2.8.1 by Incognito loaded ***
    
    [19:06:12]   Loaded.
    [19:06:12]  Loaded 5 plugins.
    
    [19:06:12] 
    [19:06:13] Ban list
    [19:06:13] --------
    [19:06:13]  Loaded: samp.ban
    [19:06:13] 
    [19:06:13] 
    [19:06:13] Filterscripts
    [19:06:13] ---------------
    [19:06:13]   Loaded 0 filterscripts.
    
    [19:06:13]  
    [19:06:13]  
    [19:06:13]  
    [19:06:13]  ======================================= 
    [19:06:13]  |                                     | 
    [19:06:13]  |        YSI version 4.00.0001        | 
    [19:06:13]  |        By Alex "Y_Less" Cole        | 
    [19:06:13]  |                                     | 
    [19:06:13]  ======================================= 
    [19:06:13]  
    [19:06:13] ---------- SERVER START ----------
    [19:06:13] [debug] OnGameModeInit()
    [19:06:13] mysql_connect: 1
    [19:06:13] ----------------------------------------------------
    [19:06:13] Script: ExGaming Roleplay - Based on Saints Roleplay
    [19:06:13] Status: Loaded, running version Zombie mode
    [19:06:13] ----------------------------------------------------
    [19:06:13] Number of vehicle models: 0
    [19:06:13] [LOADING] 14 groups loaded.
    [19:06:13] [LOADING] 438 vehicles loaded.
    [19:06:13] [LOADING] 106 houses loaded.
    [19:06:13] [LOADING] 48 turfs loaded.
    [19:06:13] [LOADING] 54 businesses loaded.
    [19:06:13] [LOADING] 105 models loaded.
    [19:06:13] [LOADING] 0 clans loaded.
    [19:06:13] [LOADING] 2 sVars loaded.
    [19:06:13] Players registered: 3
    [19:06:25] [connection] 127.0.0.1:52775 requests connection cookie.
    [19:06:26] [connection] incoming connection: 127.0.0.1:52775 id: 0
    [19:06:26] [join] RedGun has joined the server (0:127.0.0.1)
    [19:06:31] RedGun has been connected to the server (IP: 127.0.0.1).
    [19:06:36] 439 | 439 //aici e

     

  7. Acum 5 minute, WopsS a spus:

    Poți s-o pui în comanda /work. La OnVehicleStreamIn poți s-o faci mai simplu

    
    if (vehicleid == JobVehicle[forplayerid])
    {
    	SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 0);
    }

     

    Am facut cum ai spus tu, insa nu functioneaza, ramane lock, nu se descuie...

  8. Acum 18 minute, WopsS a spus:

    Salut,

    Folosește SetVehicleParamsEx să blochezi vehiculul pentru toata lumea și folosește SetVehicleParamsForPlayer să îl deblochezi pentru jucătorul care o folosește.

    Am incercat

    SetVehicleParamsEx(JobVehicle[playerid],engine,lights,alarm,1,bonnet,boot,objective);

    sa pun la comanda /work sub PutPlayerInVehicle

    si la OnVehicleStreamIn am pus ceva de genu:

    for(new vv; vv < MAX_VEHICLES; vv++)
        {
            if(vv == JobVehicle[forplayerid])
            {
                SetVehicleParamsForPlayer(vv,forplayerid,0,0);
            }
        }

    Si cand ma dau jos din vehicul si apas F e incuiata.

    Am incercat sa incerc si la OnPlayerEnterVehicle si nu merge, la fel..

    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
        if(!ispassenger)
        {
            if(vehicleid == JobVehicle[playerid])
            {
                SetVehicleParamsForPlayer(vehicleid,playerid,0,0);
            }
        }
        return 1;
    }

  9. Salut, am incercat sa fac comanda /work insa nu stiu cum pot face ca masina de la job care i-a creat-o cand a folosit /work adica JobVehicle[playerid] sa o poata folosi doar el, atunci cand alt jucator da F/ENTER la masina respectiva sa ii apare ca e incuiata, doar jucatorul proprietar al masini de la job sa aiba acces de F/ENTE in ea, ma puteti ajuta? 

    Comanda este aceasta:

    CMD:work(playerid, params[])
    {
    	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
    	if(PlayerInfo[playerid][pCarLic] == 0) return SendClientMessage(playerid, COLOR_GREY, "You don't have driving licence.");
    	if(JobWorking[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You already working. Use /stopwork if you don't want to work anymore.");
    	if(IsPlayerConnected(playerid))
    	{
    		if(!AdminDuty[playerid]) {
    			if(PlayerInfo[playerid][pJob] == 5) {
    				if(IsPlayerInRangeOfPoint(playerid, 4, Job[5][X], Job[5][Y], Job[5][Z])) {
    		            if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
    		                JobVehicle[playerid] = CreateVehicle(448, Pos[0], Pos[1], Pos[2], 90.0000, -1, -1, -1);
    		                PutPlayerInVehicleEx(playerid, JobVehicle[playerid], 0);
    		                Gas[JobVehicle[playerid]] = 100;
    		                JobWorking[playerid] = 1;
    					}
    					else return SCM(playerid, -1, "Nu poti folosi comanda intr-un vehicul.");
    				}
    			}
    		}
    	}
    	return 1;
    }

     

  10. Acum 4 ore, AddisoN a spus:
    
    if(count > 1) {
    	
    
    format(string, sizeof(string), "%s was kicked by AdmBot for being AFK for more than 30 minutes.", name); SendClientMessageToAll(COLOR_LIGHTRED, string);} else {
    format(string, sizeof(string), "%s was kicked by AdmBot for being AFK for more than 30 minutes.", stringx); strdel(string, strlen(stringx)-2, strlen(stringx)-1); SendClientMessageToAll(COLOR_LIGHTRED, string);	
    
    }

    nu merge , se trimite la fel ca la inceput

    Andrei was kicked by AdmBot for being AFK for more than 30 minutes.
    Marius was kicked by AdmBot for being AFK for more than 30 minutes.

    Inloc de

    Andrei, Marius were kicked by AdmBot for being AFK for more than 30 minutes.
  11. Salut, am urmatorul cod https://pastebin.com/AAGrBwAH si as vrea sa stiu cum as putea face ca jucatorii care primesc kick ( > 1 ) sa nu fie nevoie sa se trimita 2 mesaje pe 2 randuri , ci intr-un rand, actual trimite ceva de genu:

    Andrei was kicked by AdmBot for being AFK for more than 30 minutes.
    Marius was kicked by AdmBot for being AFK for more than 30 minutes.

    Inloc de

    Andrei, Marius were kicked by AdmBot for being AFK for more than 30 minutes.

    Cum as putea face acest lucru? Am incercat ceva de genu , am incercat sa si formatezi, nimic, nu iese

    strcat(gString, ", ");
    strcat(gString, GetName(i));

    Am incercat si asa si nu merge, apare gen

     ,  were kicked for being AFK for more than 30 minutes.

    nu le apar numele..

    new players[128], finalString[256]
    foreach(new i : Player) {
    	if(timeAFK[i] >= 15) {
    		format(players, 128, "%s, ", players, numeJucator);
    	}
    }
    
    format(finalString, 256, "%s was kicked by AdmBot for being AFK for more than 30 minutes.", players);

     

  12. La 8/14/2017 la 19:11, VaLuTzzU a spus:

    Si da , mai am o problema cred ca e bug ceva nu stiu sigur..cand dau pe cineva afara din factiune (/fpk) , e totul ok , dar cand reintra pe server este din nou in factiune

    La executarea /fpk trebuie sa faci actualizarea pentru jucatorul respectiv in baza de date, sa i se seteze group 0, rank 0 ,etc...gen incearca sa copii de la comanda uninvite de la un lider.

  13. Legat de problema de la DS, cred ca trebuie sa modifici tu masinile din baza de date.

    comanda:

    incearca sa modifici comanda /movehouse cum vrei tu, eu iti dau un model cum am facut eu

    CMD:movebiz(playerid, params[])
    {
        if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
        if(IsPlayerConnected(playerid))
    	{
    
    		if(PlayerInfo[playerid][pAdmin] < 6) return 0;
    
    	    new house,Float:pX,Float:pY,Float:pZ,query[256];
    	    if(sscanf(params, "d", house)) return SendClientMessage(playerid, -1, "Folosire: /movebiz [bizid]");
    	    GetPlayerPos(playerid, pX, pY, pZ);
    	    BizzInfo[house][bEntranceX] = pX;
    	    BizzInfo[house][bEntranceY] = pY;
    	    BizzInfo[house][bEntranceZ] = pZ;
    	    new i = house;
    	    mysql_format(SQL, query, sizeof(query), "UPDATE `bizz` SET `EntranceX`='%f',`EntranceY`='%f',`EntranceZ`='%f' WHERE `ID`='%d'",BizzInfo[house][bEntranceX],BizzInfo[house][bEntranceY],BizzInfo[house][bEntranceZ],house);
    		mysql_tquery(SQL,query,"","");
    		SendClientMessage(playerid, -1, "Ai mutat business-ul cu succes!");
    		OnPropTextdrawUpdate(2, i); //nu stiu sigur daca ai functia, cauta sa vezi daca nu elimina
    	}
    	return 1;
    }

     

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