[FilterScript] Real Life Vehicle Names
#8

Quote:
Originally Posted by milanosie
Посмотреть сообщение
And how is it not efficient?
Explain me please,
Your else-if statement is getting called ~ 200 (depends on the vehicle ID) times when the function is getting used. Is that efficient? No.
The switch statement get called once and checks the value of the given variable in a loop, until it reaches the correct variable.

Format is meant for strings with a dynamic variable in the string. E.g your name
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof name);
format(string, 128,sizeof string, "%s", name)
If you just give the string a different value (I am not sure if I am saying it right in English) without a dynamic variable in the string, you will simply just give it a different value:
pawn Код:
new name[50];
name = "Welcome milanosie!";
SendClientMessage(playerid, 0x000000FF, name);
I'm trying to explain it as simple as possible.
Reply


Messages In This Thread
Real Life Vehicle Names - by milanosie - 12.07.2012, 23:23
Re : Real Life Vehicle Names - by 'seraphin - 12.07.2012, 23:32
Re: Real Life Vehicle Names - by Lorenc_ - 12.07.2012, 23:42
Re: Real Life Vehicle Names - by Kathleen - 12.07.2012, 23:43
Re: Real Life Vehicle Names - by milanosie - 13.07.2012, 07:39
Re: Real Life Vehicle Names - by Biesmen - 13.07.2012, 07:46
Re: Real Life Vehicle Names - by milanosie - 13.07.2012, 07:47
Re: Real Life Vehicle Names - by Biesmen - 13.07.2012, 07:54
Re: Real Life Vehicle Names - by Sinner - 13.07.2012, 08:53
Re: Real Life Vehicle Names - by TheArcher - 13.07.2012, 09:40

Forum Jump:


Users browsing this thread: 1 Guest(s)