Jump to content
  • 0

comanda carupgrade


c0sminvl

Question

	if (strcmp(cmd, "/carupgrade", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			new house = PlayerInfo[playerid][pPhousekey];
			GetPlayerName(playerid, playername, sizeof(playername));
			if (house != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
			{
				new gunid[16];
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					format(string, sizeof(string), "USAGE: /carupgrade [carname]");
					SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
					SendClientMessage(playerid, COLOR_WHITE,"*** CAR UPGRADES Cost $100000 ***");
					SendClientMessage(playerid, COLOR_GRAD2,string);
					if(PlayerInfo[playerid][pLevel] >= 3)
					{
						SendClientMessage(playerid, COLOR_GRAD3, "Cars: infernus Super GT Bullet Flash Freeway");
						SendClientMessage(playerid, COLOR_GRAD3, "Cars: huntley jester landstalker merit nebula sabre stratum");
						SendClientMessage(playerid, COLOR_GRAD3, "Cars: sunrise tahoma uranus");
						SendClientMessage(playerid, COLOR_GRAD3, "Donation cars: stretch elegy phoenix hotknife bandito sultan");
					}
					SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
					return 1;
				}
				if(SBizzInfo[5][sbProducts] == 0)
				{
					GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
					return 1;
				}
				strmid(gunid, tmp, 0, strlen(cmdtext), 255);
				if (GetPlayerMoney(playerid) > 100000)
				{
					if(strcmp(gunid, "stretch", true, strlen(gunid)) == 0)
					{
					    if(PlayerInfo[playerid][pDonateRank] < 1)
					    {
					        SendClientMessage(playerid, COLOR_GREY, "   You don't have a Premium Account !");
					        return 1;
					    }
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Stretch");
						HouseInfo[house][hVec] = 409;
					}
					else if(strcmp(gunid, "hotknife", true, strlen(gunid)) == 0)
					{
					    if(PlayerInfo[playerid][pDonateRank] < 1)
					    {
					        SendClientMessage(playerid, COLOR_GREY, "   You don't have a Premium Account !");
					        return 1;
					    }
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Hotknife");
						HouseInfo[house][hVec] = 434;
					}
					else if(strcmp(gunid, "bandito", true, strlen(gunid)) == 0)
					{
					    if(PlayerInfo[playerid][pDonateRank] < 1)
					    {
					        SendClientMessage(playerid, COLOR_GREY, "   You don't have a Premium Account !");
					        return 1;
					    }
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Bandito");
						HouseInfo[house][hVec] = 568;
					}
					else if(strcmp(gunid, "sultan", true, strlen(gunid)) == 0)
					{
					    if(PlayerInfo[playerid][pDonateRank] < 1)
					    {
					        SendClientMessage(playerid, COLOR_GREY, "   You don't have a Premium Account !");
					        return 1;
					    }
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Sultan");
						HouseInfo[house][hVec] = 560;
					}
					else if(strcmp(gunid, "elegy", true, strlen(gunid)) == 0)
					{
					    if(PlayerInfo[playerid][pDonateRank] < 1)
					    {
					        SendClientMessage(playerid, COLOR_GREY, "   You don't have a Premium Account !");
					        return 1;
					    }
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Elegy");
						HouseInfo[house][hVec] = 562;
					}
					else if(strcmp(gunid, "phoenix", true, strlen(gunid)) == 0)
					{
					    if(PlayerInfo[playerid][pDonateRank] < 1)
					    {
					        SendClientMessage(playerid, COLOR_GREY, "   You don't have a Premium Account !");
					        return 1;
					    }
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Phoenix");
						HouseInfo[house][hVec] = 603;
					}
					else if(strcmp(gunid, "infernus", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Infernus");
						HouseInfo[house][hVec] = 411;
					}
					else if(strcmp(gunid, "Super GT", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Super GT");
						HouseInfo[house][hVec] = 506;
					}
					else if(strcmp(gunid, "Bullet", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Bullet");
						HouseInfo[house][hVec] = 541;
					}
					else if(strcmp(gunid, "Flash", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Flash");
						HouseInfo[house][hVec] = 565;
					}
					else if(strcmp(gunid, "Freeway", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Freeway");
						HouseInfo[house][hVec] = 463;
					}
					else if(strcmp(gunid, "huntley", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Huntley");
						HouseInfo[house][hVec] = 579;
					}
					else if(strcmp(gunid, "jester", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Jester");
						HouseInfo[house][hVec] = 559;
					}
					else if(strcmp(gunid, "landstalker", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Landstalker");
						HouseInfo[house][hVec] = 400;
					}
					else if(strcmp(gunid, "merit", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Merit");
						HouseInfo[house][hVec] = 551;
					}
					else if(strcmp(gunid, "nebula", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Nebula");
						HouseInfo[house][hVec] = 516;
					}
					else if(strcmp(gunid, "sabre", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Sabre");
						HouseInfo[house][hVec] = 475;
					}
					else if(strcmp(gunid, "stratum", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Stratum");
						HouseInfo[house][hVec] = 561;
					}
					else if(strcmp(gunid, "sunrise", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Sunrise");
						HouseInfo[house][hVec] = 550;
					}
					else if(strcmp(gunid, "tahoma", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Tahoma");
						HouseInfo[house][hVec] = 566;
					}
					else if(strcmp(gunid, "uranus", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_GRAD6, "New Upgrade: Your House Car Is Now A Uranus");
						HouseInfo[house][hVec] = 558;
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD6, "   Unrecognized Car or Donate Rank not High enough.");
						return 1;
					}
					SendClientMessage(playerid, COLOR_GRAD6, "Your new car will be delivered within 24 hours -$100000");
                    OnPropUpdate();
					GivePlayerMoney(playerid,-100000);
					SBizzInfo[5][sbTill] += 100000;
					ExtortionSBiz(5, 100000);
					SBizzInfo[5][sbProducts]--;
					PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
				}
				else
				{
					SendClientMessage(playerid, COLOR_GRAD2, "   You can't afford that ($100000)");
					return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD2, "   You don't own a house");
				return 1;
			}
		}
		return 1;
	}

As dori sa se schimbe masina instant la /carupgrade , nu dupa restart , se poate ? am vazut pe un server. Ajutati-ma va rog.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Incearca asta :

[pawn] if (strcmp(cmd, "/carupgrade", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

new house = PlayerInfo[playerid][pPhousekey];

GetPlayerName(playerid, playername, sizeof(playername));

if (house != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)

{

new gunid[16];

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

format(string, sizeof(string), "Tasteaza: /carupgrade [carname]");

SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");

SendClientMessage(playerid, COLOR_WHITE,"*** CAR UPGRADES Costa $100000 ***");

SendClientMessage(playerid, COLOR_GRAD2,string);

if(PlayerInfo[playerid][pLevel] >= 3)

{

SendClientMessage(playerid, COLOR_GRAD3, "Cars: blistacompact clover elegant emperor glendale greenwood");

SendClientMessage(playerid, COLOR_GRAD3, "Cars: huntley jester landstalker merit nebula sabre stratum");

SendClientMessage(playerid, COLOR_GRAD3, "Cars: sunrise tahoma uranus");

SendClientMessage(playerid, COLOR_GRAD3, "Donation cars: stretch elegy phoenix hotknife bandito sultan");

}

SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");

return 1;

}

if(SBizzInfo[5][sbProducts] == 0)

{

GameTextForPlayer(playerid, "~r~Numai sunt produse", 5000, 1);

return 1;

}

strmid(gunid, tmp, 0, strlen(cmdtext), 255);

if (GetPlayerMoney(playerid) > 100000)

{

if(strcmp(gunid, "stretch", true, strlen(gunid)) == 0)

{

    if(PlayerInfo[playerid][pDonateRank] < 1)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Nu ai Premium Account !");

        return 1;

    }

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Stretch");

HouseInfo[house][hVec] = 409;

}

                    else if(strcmp(gunid, "hotknife", true, strlen(gunid)) == 0)

{

    if(PlayerInfo[playerid][pDonateRank] < 1)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Nu ai Premium Account !");

        return 1;

    }

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Hotknife");

HouseInfo[house][hVec] = 434;

}

  else if(strcmp(gunid, "infernus", true, strlen(gunid)) == 0)

{

    if(PlayerInfo[playerid][pDonateRank] < 1)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Nu ai Premium Account !");

        return 1;

    }

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Infernus");

HouseInfo[house][hVec] = 411;

}

                else if(strcmp(gunid, "turismo", true, strlen(gunid)) == 0)

{

    if(PlayerInfo[playerid][pDonateRank] < 1)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Nu ai Premium Account !");

        return 1;

    }

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: YAcum ai comandat la casa ta un Turismo");

HouseInfo[house][hVec] = 451;

}

                    else if(strcmp(gunid, "bullet", true, strlen(gunid)) == 0)

{

    if(PlayerInfo[playerid][pDonateRank] < 1)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Nu ai Premium Account !");

        return 1;

    }

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Bullet");

HouseInfo[house][hVec] = 541;

}

                    else if(strcmp(gunid, "comet", true, strlen(gunid)) == 0)

{

    if(PlayerInfo[playerid][pDonateRank] < 1)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Nu ai Premium Account !");

        return 1;

    }

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Comet");

HouseInfo[house][hVec] = 480;

}

                    else if(strcmp(gunid, "banshee", true, strlen(gunid)) == 0)

{

    if(PlayerInfo[playerid][pDonateRank] < 1)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Nu ai Premium Account !");

        return 1;

    }

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Banshee");

HouseInfo[house][hVec] = 429;

}

else if(strcmp(gunid, "bandito", true, strlen(gunid)) == 0)

{

    if(PlayerInfo[playerid][pDonateRank] < 1)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Nu ai Premium Account !");

        return 1;

    }

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Bandito");

HouseInfo[house][hVec] = 568;

}

else if(strcmp(gunid, "sultan", true, strlen(gunid)) == 0)

{

    if(PlayerInfo[playerid][pDonateRank] < 1)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Nu ai Premium Account !");

        return 1;

    }

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Sultan");

HouseInfo[house][hVec] = 560;

}

else if(strcmp(gunid, "elegy", true, strlen(gunid)) == 0)

{

    if(PlayerInfo[playerid][pDonateRank] < 1)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Nu ai Premium Account !");

        return 1;

    }

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Elegy");

HouseInfo[house][hVec] = 562;

}

else if(strcmp(gunid, "phoenix", true, strlen(gunid)) == 0)

{

    if(PlayerInfo[playerid][pDonateRank] < 1)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Nu ai Premium Account !");

        return 1;

    }

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Phoenix");

HouseInfo[house][hVec] = 603;

}

else if(strcmp(gunid, "blistacompact", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Compact");

HouseInfo[house][hVec] = 496;

}

else if(strcmp(gunid, "clover", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Clover");

HouseInfo[house][hVec] = 542;

}

else if(strcmp(gunid, "elegant", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Elegant");

HouseInfo[house][hVec] = 507;

}

else if(strcmp(gunid, "emperor", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Emperor");

HouseInfo[house][hVec] = 585;

}

else if(strcmp(gunid, "glendale", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Glendale");

HouseInfo[house][hVec] = 466;

}

else if(strcmp(gunid, "greenwood", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Greenwood");

HouseInfo[house][hVec] = 492;

}

else if(strcmp(gunid, "huntley", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Huntley");

HouseInfo[house][hVec] = 579;

}

else if(strcmp(gunid, "jester", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Jester");

HouseInfo[house][hVec] = 559;

}

else if(strcmp(gunid, "landstalker", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Landstalker");

HouseInfo[house][hVec] = 400;

}

else if(strcmp(gunid, "merit", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Merit");

HouseInfo[house][hVec] = 551;

}

else if(strcmp(gunid, "nebula", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Nebula");

HouseInfo[house][hVec] = 516;

}

else if(strcmp(gunid, "sabre", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Sabre");

HouseInfo[house][hVec] = 475;

}

else if(strcmp(gunid, "stratum", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Stratum");

HouseInfo[house][hVec] = 561;

}

else if(strcmp(gunid, "sunrise", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Sunrise");

HouseInfo[house][hVec] = 550;

}

else if(strcmp(gunid, "tahoma", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Tahoma");

HouseInfo[house][hVec] = 566;

}

else if(strcmp(gunid, "uranus", true, strlen(gunid)) == 0)

{

SendClientMessage(playerid, COLOR_GRAD6, "[iNFO]: Acum ai comandat la casa ta un Uranus");

HouseInfo[house][hVec] = 558;

}

else

{

SendClientMessage(playerid, COLOR_GRAD6, "  Masina necunoscuta sau rank-ul de donator nu este suficient de mare.");

return 1;

}

SendClientMessage(playerid, COLOR_GRAD6, "Masina ta noua va fi gata in 24 de ore -$100000");

OnPropUpdate();

GivePlayerMoney(playerid,-100000);

SBizzInfo[5][sbTill] += 100000;

ExtortionSBiz(5, 100000);

SBizzInfo[5][sbProducts]--;

PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);

}

else

{

SendClientMessage(playerid, COLOR_GRAD2, "  Nu ai ($100000)");

return 1;

}

}

else

{

SendClientMessage(playerid, COLOR_GRAD2, "  Nu ai casa");

return 1;

}

}

return 1;

}[/pawn]

userbar6.jpg
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.