OPTIMIZE CODE!!!!!!!!
#1

I need to optimize code (it strongly implies)[Нужна оптимизация кода]:
Code:
/*
SAMP Сервер Биг-Смоук (все права защищены!)
Копирование материала ЗАПРЕЩЕНО!!!
*/
public OnPlayerEnterCheckpoint(playerid)
{
	switch(avtobus1[playerid])
    {
        case 1:
		{
		    if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 437) return SendClientMessage(playerid,RED,"Возьми автобус для работы.");
			DisablePlayerRaceCheckpoint(playerid);
			avtobus1[playerid] = 2;
			SetPlayerRaceCheckpoint(playerid,0,1110.2404,-1743.8105,13.3984,1162.5702,-1743.5231,13.3984,5.0);
			return true;
		}
        
        case 2:
		{
        	if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 437) return SendClientMessage(playerid,RED,"Возьми автобус для работы.");
        	DisablePlayerRaceCheckpoint(playerid);
        	avtobus1[playerid] = 3;
        	SetPlayerRaceCheckpoint(playerid,0,1162.5702,-1743.5231,13.3984,1172.7688,-1751.2262,13.3984,5.0);
			return true;
		}
        
..............
        
        case 82:
		{
        	if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 437) return SendClientMessage(playerid,RED,"Возьми автобус для работы.");
        	DisablePlayerRaceCheckpoint(playerid);
        	avtobus1[playerid] = 83;
       		SetPlayerRaceCheckpoint(playerid,0,1109.9530,-1737.7393,13.5226,1109.9530,-1737.7393,100.0,5.0);
			return true;
		}
        
        case 83:
		{
			if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 437) return SendClientMessage(playerid,RED,"Возьми автобус для работы.");
        	DisablePlayerRaceCheckpoint(playerid);
        	SetPlayerSkin(playerid,avtobus3[playerid]);
        	SendClientMessage(playerid,0x006ED9AA,"Ты получил за свою работу: {CC3300}2000$");
        	GameTextForPlayer(playerid,"~G~+2000$",7500,5);
        	GivePlayerMoney(playerid,2000);
			new string[16],PlayerName[24];
			GetPlayerName(playerid,PlayerName,40);
			format(string,sizeof(string),"Accounts/%s.ini",PlayerName);
			new iniFile = ini_openFile(string);
			ini_getInteger(iniFile,"Avtobus",PIp[pAvtobus]);
			ini_setInteger(iniFile,"Avtobus",PIp[pAvtobus]+1);
			ini_closeFile(iniFile);
			return true;
		}
    }
	return true;
}
They're all the same (the difference in the coordinates) except 83 case!!!(758 size[Строк])
Reply
#2

You can create a stock !!!!!!!!!!!! Check this out !!!!!!! https://sampwiki.blast.hk/wiki/Stocks
Reply
#3

Quote:
Originally Posted by iJumbo
View Post
You can create a stock !!!!!!!!!!!! Check this out !!!!!!! https://sampwiki.blast.hk/wiki/Stocks
Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)