Jump to content

Problema /editcarmodel


HiImCristi

Recommended Posts

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;
    }

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

  • 1 month later...

  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
Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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