Jump to content

Recommended Posts

Posted

Am aceasta comanda in gm dar de fiecare data cand o folosesc imi blocheaza tot si imi spameaza mesajul ''Car is now ID'',nu pot folosi nicio comanda si modelul se schimba dupa restart la server,stie cineva cum o pot face sa imi schimbe direct cand sunt pe sv si sa nu se mai blocheze?

    if(strcmp(cmd, "/editmodelcar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 4)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   Nu esti Admin !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /editcarmodel [modelid]");
                return 1;
            }
            new proplev = strval(tmp);
            for(new i = 0; i < sizeof(CarInfo); i++)
            {
                if(IsAnOwnableCar(idcar))
                {
                    CarInfo[idcar][cModel] = proplev;
                    format(string, sizeof(string), "Car: %d is now %d",idcar,CarInfo[idcar][cModel]);
                    //.SendClientMessage(playerid, COLOR_GRAD2, string);
                    OnPropUpdate();
                }
            }
        }
        return 1;
    }

Posted
if(strcmp(cmd, "/editmodelcar", true) == 0)
{
	if(IsPlayerConnected(playerid))
	{
		if(PlayerInfo[playerid][pAdmin] < 4)
		{
			SendClientMessage(playerid, COLOR_GRAD2, "   Nu esti Admin !");
			return 1;
		}
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /editcarmodel [modelid]");
			return 1;
		}
		new proplev = strval(tmp);
		if(IsPlayerInAnyVehicle(playerid) == false ) return SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii intr-un vehicul");
		new idcar = GetPlayerVehicleID(playerid);
		if(IsAnOwnableCar(idcar) == false) return SendClientMessage(playerid, 0xFFFFFFFF, "Trebuei sa fii intr-un vehicul personal")
		CarInfo[idcar][cModel] = proplev;
		format(string, sizeof(string), "Car: %d is now %d",idcar,CarInfo[idcar][cModel]);
		SendClientMessage(playerid, COLOR_GRAD2, string);
		OnPropUpdate();
		}
	}
	return 1;
}

Acuma trebuie sa te urci in vehiculul respectiv pentru a schimba modelul. Sa-mi spui daca merge.

  • Upvote 2

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

  • 1 month later...
Posted (edited)

  Astea 3 linii:

 if(IsPlayerInAnyVehicle(playerid) == false ) return SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii intr-un vehicul");
        new idcar = GetPlayerVehicleID(playerid);
        if(IsAnOwnableCar(idcar) == false) return SendClientMessage(playerid, 0xFFFFFFFF, "Trebuei sa fii intr-un vehicul personal")

 Imi da aceste warning-uri.

warning 213: tag mismatch
 warning 219: local variable "idcar" shadows a variable at a preceding level
:warning 213: tag mismatch

...

Edited by HiImCristi
Posted
On 26.02.2016 at 11:14, HiImCristi said:

  Astea 3 linii:

 if(IsPlayerInAnyVehicle(playerid) == false ) return SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii intr-un vehicul");
        new idcar = GetPlayerVehicleID(playerid);
        if(IsAnOwnableCar(idcar) == false) return SendClientMessage(playerid, 0xFFFFFFFF, "Trebuei sa fii intr-un vehicul personal")

 Imi da aceste warning-uri.

warning 213: tag mismatch
 warning 219: local variable "idcar" shadows a variable at a preceding level
:warning 213: tag mismatch

...

if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii intr-un vehicul");
        new idcar = GetPlayerVehicleID(playerid);
        if(!IsAnOwnableCar(idcar) ) return SendClientMessage(playerid, 0xFFFFFFFF, "Trebuei sa fii intr-un vehicul personal")

 

Incearca asa.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

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