[HELP] Buy wheels
#9

Quote:
Originally Posted by RedCode
Посмотреть сообщение
maramizo i will test it

error 001: expected token: ";", but found "new"

Code : new string[128], rims;
if(sscanf(params, "d", rims))
My bad, forgot a semi-colon, lmao.
Код:
CMD:buyrims(playerid, params[])
{
    if(PlayerInfo[playerid][pLevel] >= 1)
	{
		/*if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
	    {
	        SendClientMessage(playerid,COLOR_WHITE, "You aren't ON-DUTY.");
			return 1;
	    }*/
		
		if(!IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessageEx(playerid, COLOR_GRAD1, " You are not in the vehicle / You are not the driver");
		{
			new iPlayer = -1, iVeh;
			foreach(Player, i)
			{
                iPlayerVeh = GetPlayerVehicle(i, iVeh);
                if(iPlayerVeh != -1) 
				{
                        if(i != playerid) return SendClientMessage(playerid,COLOR_GREY,"You cannot change rims of vehicles that do not belong to you.");
                }
			}
			if(iPlayerVeh == -1) return SendClientMessage(playerid, COLOR_GREY, "You cannot change rims of vehicles that do not belong to you.");
			new string[128], rims;
			if(sscanf(params, "d", rims))
			{
				SendClientMessageEx(playerid, COLOR_WHITE, "USE: /buyrims [rimsid]");
				SendClientMessageEx(playerid, COLOR_GRAD4, "|1 Cutter |2 Shadow |3 Rimshine |4 Wires |5 Classic |6 Twist");
				SendClientMessageEx(playerid, COLOR_GRAD2, "|7 Gold Rims |8 Dollar |9 Grove |10 Import ");
				SendClientMessageEx(playerid, COLOR_ORANGE, " Be sure to have $30000 in hand to buy rims for your vehicle");
				return 1;
			}
			switch (rims)
			{
				case 1:
				{
				    if (GetPlayerCash(playerid) >= 30000)
					{
					    GivePlayerCash(playerid, -30000);
						AddVehicleComponent(GetPlayerVehicleID(playerid), 1079);
						SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
					}
					else
					{
						SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
					}
				}
				case 2:
				{
				    if (GetPlayerCash(playerid) >= 30000)
					{
					    GivePlayerCash(playerid, -30000);
						AddVehicleComponent(GetPlayerVehicleID(playerid), 1073);
						SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
					}
					else
					{
						SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
					}
				}
				case 3:
				{
				    if (GetPlayerCash(playerid) >= 30000)
					{
					    GivePlayerCash(playerid, -30000);
						AddVehicleComponent(GetPlayerVehicleID(playerid), 1075);
						SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
					}
					else
					{
						SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
					}
				}
				case 4:
				{
				    if (GetPlayerCash(playerid) >= 30000)
					{
					    GivePlayerCash(playerid, -30000);
						AddVehicleComponent(GetPlayerVehicleID(playerid), 1076);
						SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
					}
					else
					{
						SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
					}
				}
				case 5:
				{
				    if (GetPlayerCash(playerid) >= 30000)
					{
					    GivePlayerCash(playerid, -30000);
						AddVehicleComponent(GetPlayerVehicleID(playerid), 1077);
						SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
					}
					else
					{
						SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
					}
				}
				case 6:
				{
				    if (GetPlayerCash(playerid) >= 30000)
					{
					    GivePlayerCash(playerid, -30000);
						AddVehicleComponent(GetPlayerVehicleID(playerid), 1078);
						SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
					}
					else
					{
						SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
					}
				}
				case 7:
				{
				    if (GetPlayerCash(playerid) >= 30000)
					{
					    GivePlayerCash(playerid, -30000);
						AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);
						SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
					}
					else
					{
						SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
					}
				}
				case 8:
				{
				    if (GetPlayerCash(playerid) >= 30000)
					{
					    GivePlayerCash(playerid, -30000);
						AddVehicleComponent(GetPlayerVehicleID(playerid), 1083);
						SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
					}
					else
					{
						SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
					}
				}
				case 9:
				{
				    if (GetPlayerCash(playerid) >= 30000)
					{
					    GivePlayerCash(playerid, -30000);
						AddVehicleComponent(GetPlayerVehicleID(playerid), 1081);
						SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
					}
					else
					{
						SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
					}
				}
				case 10:
				{
				    if (GetPlayerCash(playerid) >= 30000)
					{
					    GivePlayerCash(playerid, -30000);
						AddVehicleComponent(GetPlayerVehicleID(playerid), 1082);
						SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
					}
					else
					{
						SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
					}
				}
				default:
				{
					format(string, sizeof(string), "   Invalid rims", rims);
				}
			}
		}
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GRAD1, "You can't use this command!");
	}
	return 1;
}
Reply


Messages In This Thread
Delete this - by RedCode - 28.02.2015, 21:01
Re: [HELP] Buy wheels - by CalvinC - 28.02.2015, 21:05
Re: [HELP] Buy wheels - by RedCode - 28.02.2015, 21:10
Re: [HELP] Buy wheels - by RedCode - 28.02.2015, 23:33
Re: [HELP] Buy wheels - by kyriakos587 - 28.02.2015, 23:37
Re: [HELP] Buy wheels - by maramizo - 28.02.2015, 23:38
Re: [HELP] Buy wheels - by RedCode - 28.02.2015, 23:40
Re: [HELP] Buy wheels - by RedCode - 28.02.2015, 23:42
Re: [HELP] Buy wheels - by maramizo - 28.02.2015, 23:46
Re: [HELP] Buy wheels - by RedCode - 28.02.2015, 23:50

Forum Jump:


Users browsing this thread: 3 Guest(s)