Jump to content
  • 0

Question

Posted

Capture.PNG.cbd7ec31ea86aeb98ab0a7c719de64de.PNG

CMD:vcreate(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
	if(PlayerInfo[playerid][pAdmin] >= 5)
	{
		new id,model,string[128],giveplayer[30],total;
		if(sscanf(params, "ui", id, model)) return SCM(playerid, COLOR_GREY, "Syntax:{FFFFFF} /vcreate [playerid] [model]");
		if(model < 400 || model > 611) return SCM(playerid, COLOR_GREY, "Invalid car ID! (400-611)");
		if(IsPlayerConnected(id))
		{
			if(id != INVALID_PLAYER_ID)
			{
				for(new v; v < MAX_PERSONAL_VEHICLES; v++)
				{
					if(PlayerInfo[id][pCar][v] != -1) total++;
				}
				if(total+1 > PlayerInfo[id][pCarSlots])
				{
					SendClientMessage(playerid, COLOR_GREY, "This player have all vehicles slots full.");
					return 1;
				}
				GetPlayerName(id, giveplayer, sizeof(giveplayer));
				CreateVEH[playerid] = model;
				CreateVEHID[playerid] = id;
				format(string, sizeof(string), "Esti sigur ca vrei sa-i dai lui %s masina %s?\n\nAbuzul de aceasta comanda poate duce la scoaterea ta din staff!", giveplayer, aVehicleNames[model - 400]);
				ShowPlayerDialog(playerid, DIALOG_VCREATE, DIALOG_STYLE_MSGBOX, "Personal Vehicle Create", string, "Da", "Nu");
			}
		}
		else return SendClientMessage(playerid, COLOR_GREY, "Player not connected.");
	}
	else return SendClientMessage(playerid, COLOR_LIGHTGREEN3, AdminOnly);
	return 1;
}

 

11 answers to this question

Recommended Posts

  • 0
Posted

Poftim, ia vezi, iar ce tema folosesti la sublime ?


CMD:vcreate(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
    if(PlayerInfo[playerid][pAdmin] >= 5)
    {
        new id,model,string[128],giveplayer[30],total;
        if(sscanf(params, "ui", id, model)) return SCM(playerid, COLOR_WHITE,"{AB0000}Usage: {FFFFFF}/vcreate [playerid] [model]");
        if(model < 400 || model > 611) return SCM(playerid, COLOR_GREY, "Invalid car ID! (400-611)");
        if(IsPlayerConnected(id))
        {
            if(id != INVALID_PLAYER_ID)
            {
                for(new v; v < MAX_PERSONAL_VEHICLES; v++)
                {
                    if(PlayerInfo[id][pCar][v] != -1) total++;
                }
                if(total+1 > PlayerInfo[id][pCarSlots])
                {
                    SendClientMessage(playerid, COLOR_GREY, "This player have all vehicles slots full.");
                    return 1;
                }
                GetPlayerName(id, giveplayer, sizeof(giveplayer));
                CreateVEH[playerid] = model;
                CreateVEHID[playerid] = id;
                format(string, sizeof(string), "Esti sigur ca vrei sa-i dai lui %s masina %s?\n\nAbuzul de aceasta comanda poate duce la scoaterea ta din staff!", giveplayer, aVehicleNames[model - 400]);
                ShowPlayerDialog(playerid, DIALOG_VCREATE, DIALOG_STYLE_MSGBOX, "Personal Vehicle Create", string, "Da", "Nu");
            }
        }
        else return SendClientMessage(playerid, COLOR_GREY, "Player not connected.");
    }
    else return SendClientMessage(playerid, COLOR_LIGHTGREEN3, AdminOnly);
    return 1;
}

  • 0
Posted
Acum 2 minute, andrei9971 a spus:

Lasa pCar cum era inainte si incearca asa: 


if(PlayerInfo[id][pCar] != -1) total++;

 

Acum apare asta Capture.PNG.11b2852b565214f0c618f3cb052f4bfc.PNG

  • 0
Posted

pune pCarSlots la pInfo, si

si fa variabila CreateVEH[MAX_PLAYERS]

, apoi dai compile.

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.