ANNOUNCE

Probleme | Intrebari | Nelamuriri - Pawno

609 posts in this topic

Din cate vad nu apare nimic: http://pastebin.com/6srJmAY8              

Imi vine sa ma dau cu capul de pereti ... mai ales ca , se inchid masinile si peste ceva timp se deschid din nou dupa se inchid ... ma gandeam ca poate sa fie vreun flood ceva la server ca altfel nu am idee si nimeni nu mi-a gasit inca o solutie la problema acesta :((

Ai un sistem de control a-l motorului de folosesti SetVehicleParamsEx in callback-ul OnVehicleSpawn(vehicleid) ?

Daca da, inlocuieste:

SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);

cu

GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF);


Revino cu un raspuns ...

Share this post


Link to post
Share on other sites

Mi se pare ca am reparat , nu aveam idletimer si de cand l-am bagat nu mi sau mai blocat masinile , cred ca era un timer care blocau masinile , acum nu stiu sigur , momentan nu sa intamplat , oricum multumesc pentru tot ajutorul dispus.

Share this post


Link to post
Share on other sites

Am pus OnVehicleSpawn  ,  OnPlayerEnterVehicle  ,  OnPlayerStateChange   intr-un pastebin .. nu inteleg cred ca ma chinui de cateva saptamani cu problema acesta :( http://pastebin.com/Q8743FD6    singura solutia la care m-am gandit ca , poate cineva imi floodeaza sv si poate sa se cauzeze astea sau ceva de genu :((

Share this post


Link to post
Share on other sites

Salut, cine ma ajuta si pe mine cu o mica problema. Vreau sa modific la user, adica daca fac un cont cu XYZ si eu vreau sa ma loghez cu xyz (litere mici) sa ma pot loga nu sa fac alt cont. o seara buna.

Share this post


Link to post
Share on other sites

Salut, cine ma ajuta si pe mine cu o mica problema. Vreau sa modific la user, adica daca fac un cont cu XYZ si eu vreau sa ma loghez cu xyz (litere mici) sa ma pot loga nu sa fac alt cont. o seara buna.

 

Ce tip de scriere / citire (manipulare) de date folosesti ? y_ini,mysql,dini ?

Share this post


Link to post
Share on other sites

Ce tip de scriere / citire (manipulare) de date folosesti ? y_ini,mysql,dini ?

.ini

Share this post


Link to post
Share on other sites
// = Comanda: /getgift
CMD:getgift(playerid, params[])
{
       if(PlayerInfo[playerid][pConnectTime] >= 3)
	   {
			if(IsPlayerInRangeOfPoint(playerid, 15.0, 1123.7257,-1468.3381,15.7514))
			{
				format(string, sizeof(string), "Poti folosi /getgift peste %d ore.", PlayerInfo[playerid][pGiftHours]);
                 if(PlayerInfo[playerid][pGiftHours] == 0)
				{
	    new cadou = random(3);
		switch(cadou)
		{
		    case 0:
		    {
				new Bani = 200000 + random(1000000 + 1);
				new string[144];
				GivePlayerCash(playerid, Bani);
				format(string, sizeof(string), ""#Culoare1"NumeServer | "#Culoare2"Ai primit cadou "#Culoare3"%s "#Culoare2"!!!",GFM(Bani));
				SendClientMessage(playerid, -1, string);
		    }
		    case 1:
		    {
		        PlayerInfo[playerid][pLevel] ++;
		        SalveazaDateMySQL(playerid,"Level");
		        SendClientMessage(playerid, -1, ""#Culoare1"NumeServer | "#Culoare2"Ai primit cadou "#Culoare3"Level Up "#Culoare2"!!!");
		    }
		    case 2:
		    {
		        new string[144];
		        new Exp = 5 + random(50 + 1);
		        PlayerInfo[playerid][pExp] += Exp;
		        SalveazaDateMySQL(playerid,"RespectPoint");
				PlayerInfo[playerid][pConnectTime] += Exp;
				SalveazaDateMySQL(playerid,"TimpConectat");
				format(string, sizeof(string), ""#Culoare1"NumeServer | "#Culoare2"Ai primit cadou "#Culoare3"%d "#Culoare2" respect !!!",Exp);
				SendClientMessage(playerid, -1, string);
		        }
					PlayerInfo[playerid][pGiftHours] = 4;
				}
			else
			{
				SendClientMessage(playerid,COLOR_WHITE, "Nu esti la giftbox.");
			}
		}
		else SendClientMessage(playerid,COLOR_YELLOW,"The gift is not active.");
	}
	else SendClientMessage(playerid,COLOR_WHITE, "Ai nevoie de 3 ore jucate pentru a folosi comanda /getgift.");
	return 1;
}

D:\Sv meu\gamemodes\GameModev1.4.pwn(40336) : error 017: undefined symbol "string"
D:\Sv meu\gamemodes\GameModev1.4.pwn(40336) : error 017: undefined symbol "string"
D:\Sv meu\gamemodes\GameModev1.4.pwn(40336) : error 029: invalid expression, assumed zero
D:\Sv meu\gamemodes\GameModev1.4.pwn(40336) : fatal error 107: too many error messages on one line

Am si eu nevoie de putin ajutor,nu i dau de cap

Share this post


Link to post
Share on other sites

Pai tu nu ai definit unde trebuie variabila string, de aici iti vine si undefined symbol "string". Tu o definesti undeva intr-o lini de cod doar, dar vad ca dupa folosesti si altundeva "string". Deci o definesti mai sus.

 

Aici ai codul aranjat:

CMD:getgift(playerid, params[])
{
	if(PlayerInfo[playerid][pConnectTime] >= 3)
	{
		if(IsPlayerInRangeOfPoint(playerid, 15.0, 1123.7257,-1468.3381,15.7514))
		{
			new string[144];
			format(string, sizeof(string), "Poti folosi /getgift peste %d ore.", PlayerInfo[playerid][pGiftHours]);
			if(PlayerInfo[playerid][pGiftHours] == 0)
			{
				new cadou = random(3);
				switch(cadou)
				{
					case 0:
					{
						new Bani = 200000 + random(1000000 + 1);
						GivePlayerCash(playerid, Bani);
						format(string, sizeof(string), ""#Culoare1"NumeServer | "#Culoare2"Ai primit cadou "#Culoare3"%s "#Culoare2"!!!",GFM(Bani));
						SendClientMessage(playerid, -1, string);
					}
					case 1:
					{
						PlayerInfo[playerid][pLevel] ++;
						SalveazaDateMySQL(playerid,"Level");
						SendClientMessage(playerid, -1, ""#Culoare1"NumeServer | "#Culoare2"Ai primit cadou "#Culoare3"Level Up "#Culoare2"!!!");
					}
					case 2:
					{
						new Exp = 5 + random(50 + 1);
						PlayerInfo[playerid][pExp] += Exp;
						SalveazaDateMySQL(playerid,"RespectPoint");
						PlayerInfo[playerid][pConnectTime] += Exp;
						SalveazaDateMySQL(playerid,"TimpConectat");
						format(string, sizeof(string), ""#Culoare1"NumeServer | "#Culoare2"Ai primit cadou "#Culoare3"%d "#Culoare2" respect !!!",Exp);
						SendClientMessage(playerid, -1, string);
					}
					PlayerInfo[playerid][pGiftHours] = 4;
				}
			} else SendClientMessage(playerid,COLOR_YELLOW,"The gift is not active.");
		} else SendClientMessage(playerid,COLOR_WHITE, "Nu esti la giftbox.");
	} else SendClientMessage(playerid,COLOR_WHITE, "Ai nevoie de 3 ore jucate pentru a folosi comanda /getgift.");
	return 1;
}
  • Like 1

Share this post


Link to post
Share on other sites
D:\Sv meu\gamemodes\GameModev1.4.pwn(40371) : error 010: invalid function or declaration
D:\Sv meu\gamemodes\GameModev1.4.pwn(40372) : error 010: invalid function or declaration

linii:
} else SendClientMessage(playerid,COLOR_WHITE, "Ai nevoie de 3 ore jucate pentru a folosi comanda /getgift.");
	return 1;

:/

Share this post


Link to post
Share on other sites
CMD:getgift(playerid, params[])
{
	if(PlayerInfo[playerid][pConnectTime] < 3) return SendClientMessage(playerid,0x0054A8FF, "Ai nevoie de 3 ore jucate pentru a folosi comanda /getgift.");
	if(IsPlayerInRangeOfPoint(playerid, 15.0, 1123.7257,-1468.3381,15.7514))
	{
		new string[144];
		format(string, sizeof(string), "Poti folosi /getgift peste %d ore.", PlayerInfo[playerid][pGiftHours]);
		if(PlayerInfo[playerid][pGiftHours] != 0) return SendClientMessage(playerid,0x0054A8FF,"You need to have 0 gift hours to do this.");
		new cadou = random(3);
		switch(cadou)
		{
			case 0:
			{
				new Bani = 200000 + random(1000000 + 1);
				GivePlayerCash(playerid, Bani);
				format(string, sizeof(string), ""#Culoare1"NumeServer | "#Culoare2"Ai primit cadou "#Culoare3"%s "#Culoare2"!!!",GFM(Bani));
				SendClientMessage(playerid, -1, string);
			}
			case 1:
			{
				PlayerInfo[playerid][pLevel] ++;
				SalveazaDateMySQL(playerid,"Level");
				SendClientMessage(playerid, -1, ""#Culoare1"NumeServer | "#Culoare2"Ai primit cadou "#Culoare3"Level Up "#Culoare2"!!!");
			}
			case 2:
			{
				new Exp = 5 + random(50 + 1);
				PlayerInfo[playerid][pExp] += Exp;
				SalveazaDateMySQL(playerid,"RespectPoint");
				PlayerInfo[playerid][pConnectTime] += Exp;
				SalveazaDateMySQL(playerid,"TimpConectat");
				format(string, sizeof(string), ""#Culoare1"NumeServer | "#Culoare2"Ai primit cadou "#Culoare3"%d "#Culoare2" respect !!!",Exp);
				SendClientMessage(playerid, -1, string);
			}
			PlayerInfo[playerid][pGiftHours] = 4;
		}
	} else SendClientMessage(playerid,0x0054A8FF, "Nu esti la giftbox.");
	return 1;
}

Ti-am simplificat codul dar sincer nu stiu de ce primesti acele erori .. eu am compilat la mine si era ok.

Share this post


Link to post
Share on other sites


D:\Sv meu\gamemodes\GameModev1.4.pwn(40368) : error 002: only a single statement (or expression) can follow each "case"

D:\Sv meu\gamemodes\GameModev1.4.pwn(40368) : error 029: invalid expression, assumed zero

D:\Sv meu\gamemodes\GameModev1.4.pwn(40368) : warning 215: expression has no effect

D:\Sv meu\gamemodes\GameModev1.4.pwn(40368) : error 001: expected token: ";", but found "]"

D:\Sv meu\gamemodes\GameModev1.4.pwn(40368) : fatal error 107: too many error messages on one line

 

linia:

}

PlayerInfo[playerid][pGiftHours] = 4;

}

Share this post


Link to post
Share on other sites


D:\Sv meu\gamemodes\GameModev1.4.pwn(40368) : error 002: only a single statement (or expression) can follow each "case"

D:\Sv meu\gamemodes\GameModev1.4.pwn(40368) : error 029: invalid expression, assumed zero

D:\Sv meu\gamemodes\GameModev1.4.pwn(40368) : warning 215: expression has no effect

D:\Sv meu\gamemodes\GameModev1.4.pwn(40368) : error 001: expected token: ";", but found "]"

D:\Sv meu\gamemodes\GameModev1.4.pwn(40368) : fatal error 107: too many error messages on one line

 

linia:

}

PlayerInfo[playerid][pGiftHours] = 4;

}


CMD:getgift(playerid, params[])

{

if(PlayerInfo[playerid][pConnectTime] < 3) return SendClientMessage(playerid,0x0054A8FF, "Ai nevoie de 3 ore jucate pentru a folosi comanda /getgift.");

if(IsPlayerInRangeOfPoint(playerid, 15.0, 1123.7257,-1468.3381,15.7514))

{

new string[144];

format(string, sizeof(string), "Poti folosi /getgift peste %d ore.", PlayerInfo[playerid][pGiftHours]);

if(PlayerInfo[playerid][pGiftHours] != 0) return SendClientMessage(playerid,0x0054A8FF,"You need to have 0 gift hours to do this.");

new cadou = random(3);

switch(cadou)

{

case 0:

{

new Bani = 200000 + random(1000000 + 1);

GivePlayerCash(playerid, Bani);

format(string, sizeof(string), ""#Culoare1"NumeServer | "#Culoare2"Ai primit cadou "#Culoare3"%s "#Culoare2"!!!",GFM(Bani));

SendClientMessage(playerid, -1, string);

}

case 1:

{

PlayerInfo[playerid][pLevel] ++;

SalveazaDateMySQL(playerid,"Level");

SendClientMessage(playerid, -1, ""#Culoare1"NumeServer | "#Culoare2"Ai primit cadou "#Culoare3"Level Up "#Culoare2"!!!");

}

case 2:

{

new Exp = 5 + random(50 + 1);

PlayerInfo[playerid][pExp] += Exp;

SalveazaDateMySQL(playerid,"RespectPoint");

PlayerInfo[playerid][pConnectTime] += Exp;

SalveazaDateMySQL(playerid,"TimpConectat");

format(string, sizeof(string), ""#Culoare1"NumeServer | "#Culoare2"Ai primit cadou "#Culoare3"%d "#Culoare2" respect !!!",Exp);

SendClientMessage(playerid, -1, string);

}

}

PlayerInfo[playerid][pGiftHours] = 4;

} else SendClientMessage(playerid,0x0054A8FF, "Nu esti la giftbox.");

return 1;

}

Share this post


Link to post
Share on other sites

Multumesc frumos!

Share this post


Link to post
Share on other sites

Br2676B.png Help? Nu mai stiu ce sa ii fac :|

17098: derby = CreatePickup(1239, 23, 1265.795410,-2494.295654,1362.279907);//Derby

17881: derby[6] = AddStaticVehicle(543,1224.0728,-2556.1130,1362.4227,359.3243,8,90); 

PLS HELP! ...Am incercat tot!

Share this post


Link to post
Share on other sites

Br2676B.png Help? Nu mai stiu ce sa ii fac :|

17098: derby = CreatePickup(1239, 23, 1265.795410,-2494.295654,1362.279907);//Derby

17881: derby[6] = AddStaticVehicle(543,1224.0728,-2556.1130,1362.4227,359.3243,8,90); 

PLS HELP! ...Am incercat tot!

 

Tu ai definit derby de tip array.

 

deci derby la tine o sa devina derby[x].

 

Loose identation - asta inseamna ca nu aranjezi cum trebuie codul.  Daca vrei sa nu mai primesti warning, defineste in cap: #pragma tabsize 0. Dar nu iti sugerez sincer .. vezi pe net tutoriale cum sa identezi bine codul.

Share this post


Link to post
Share on other sites
case DIALOG_VEHICLE1:
		{
			if(response)
			{
				switch(listitem)
				{
					case 0:
					{
					new string[256],sendername[MAX_PLAYER_NAME];
                    new id = GetPlayerVehicleID(playerid);
					new vehicleid = id;
					SetVehicleToRespawn(vehicleid);
                    format(string, sizeof(string), "Vehiculul cu ID-ul [%s] a fost respawnat.", vehicleid);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
	                    }

Am facut dialog sa ti poti respawna masina,cam cum e pe toate sv,doar ca trebuie sa fiu in masina ca sa se poata respawna

Cum fac ca sa nu trebuiasca sa fiu in masina?

Share this post


Link to post
Share on other sites

Cauta mesajul acela de ti-l arata ca trebuie sa te afli in masina si posteaza tot codul, restrictia trebuie sa fie langa acel mesaj.

Share this post


Link to post
Share on other sites

Nu imi dau seama....

Share this post


Link to post
Share on other sites

Se pare ca dupa atatia ani de zile, unii nu pricep ca prin rezolvarea problemei trebuie tot codul (ma refer la un filterscript, unde ai codurile specifice doar pt acel/acea comanda).
Automat deducem ca o comanda are mai multe parti (una avansata), din care noi nu putem deduce ce ar trebui sa contina.
Veniti cu tot limbajul C++ ce tine de acea comanda pentru a va putea ajuta.

Share this post


Link to post
Share on other sites

Asta i comanda

//===cars

CMD:cars(playerid, params[])
{
    new playername[24];
    GetPlayerName(playerid, playername, sizeof(playername));
    new info[2048], bool:found;
    for(new i=MasiniDinGamemode; i < MAX_VEHICLES; i++)
    {
        if(VehicleCreated[i] == VEHICLE_PLAYER && strcmp(VehicleOwner[i], playername) == 0)
        {
            found = true;
            format(info, sizeof(info), "%s"#Culoare2"ID: "#Culoare1"%d "#Culoare2"Vehicul: "#Culoare1"%s "#Culoare2"["#Culoare1"%s"#Culoare2"]\n", info, i, VehiclesName[VehicleModel[i]-400], VehicleNumberPlate[i]);
        }
    }
    if(!found) return SendClientMessage(playerid, COLOR_RED, ""#Culoare1"NumeServer | "#Culoare2"Nu ai nici un vehicul .");
    ShowPlayerDialog(playerid, DIALOG_VEHICLE, DIALOG_STYLE_LIST, ""#Culoare1"Masinile Personale", info, "Select", "Renunta");
    return 1;
}

Asta i dialog

case DIALOG_VEHICLE:
{
        if(response)
        {
            ShowPlayerDialog(playerid, DIALOG_VEHICLE1, DIALOG_STYLE_LIST, "Optiuni", "Respawneaz-o\nLocalizeaz-o\nCumpara Asigurare(suma)\nReseteaza Kilometrajul(suma)", "Ok", "Cancel");
        }
    }

Si aici ,la case 0 e problema cu respawnat ul masinii

case DIALOG_VEHICLE1:
        {
            if(response)
            {
                switch(listitem)
                {
                    case 0:
                    {
                    new string[256],sendername[MAX_PLAYER_NAME];
new id = GetPlayerVehicleID(playerid);
                    new vehicleid = id;
                    SetVehicleToRespawn(vehicleid);
format(string, sizeof(string), "Vehiculul cu ID-ul [%s] a fost respawnat.", vehicleid);
GetPlayerName(playerid, sendername, sizeof(sendername));
     }

Asta am luat o de la comanda 

//=============================================================================================================================================================
// = Comanda: /respawnthiscar
//=============================================================================================================================================================

if(strcmp(cmd, "/respawnthiscar", true) == 0 || strcmp(cmd, "/rtc", true) == 0)
    {
     if(IsPlayerConnected(playerid))
     {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†SendClientMessage(playerid, COLOR_GRAD1, "¬Ľ Scrie: /r(espawn)t(his)c(ar) [carid]");
                return 1;
            }
            new testcar = strval(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                SetVehicleToRespawn(testcar);
format(string, sizeof(string), "Vehiculul cu ID-ul [%d] a fost respawnat.", testcar);
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pAdmin] >= 1)
{
format(string, sizeof(string), ""#Culoare1"NumeServer | "#Culoare2"Admin %s a respawnat vehiculul [ID: %d].",sendername,testcar);
                SendAdminMessage(COLOR_YELLOW,string);
                }
            }
            else
            {
         SendClientMessage(playerid, COLOR_RED, ""#Culoare1"NumeServer | {ffffff}Ne pare rau, dar nu ai acces la aceasta comanda.");
         }
        }
        return 1;
    }

Vreau sa fac sa nu trebuiasca sa fii in masina sa o poti respawna

Edited by GNR

Share this post


Link to post
Share on other sites

Ia incearca asa:

CMD:respawnthiscar(playerid, params[]) {
	new carid = GetPlayerVehicleID(playerid);
	if(PlayerInfo[playerid][pAdmin] >= 1) {
		if(!sscanf(params, "i", carid)) {
			if(IsPlayerInVehicle(playerid, carid)) {
				new string[128];
				format(string, sizeof(string), "Vehiculul cu ID-ul %d a fost respawnat.", carid);
				SendAdminMessage(COLOR_YELLOW, string);
				SetVehicleToRespawn(carid);
			} else SendClientMessage(playerid, COLOR_RED, "Trebuie sa fii in masina pe care vrei sa o rezpawnezi.");
		} else SendClientMessage(playerid, COLOR_GRAD1, "¬Ľ Scrie: /r(espawn)t(his)c(ar) [carid]");
	} else SendClientMessage(playerid, COLOR_RED, ""#Culoare1"NumeServer | {ffffff}Ne pare rau, dar nu ai acces la aceasta comanda.");
	return 1;
}

CMD:rtc(playerid, params[]) {
	return cmd_respawnthiscar(playerid, params);
}

Share this post


Link to post
Share on other sites

Kurama, uite ce doreste el sa faca:

 

 

 

Vreau sa fac sa nu trebuiasca sa fii in masina sa o poti respawna

 

Eu insa nu vad restrictie in privinta asta in cod ..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.