08.10.2010, 18:12
Sorry, its this way:
Regarding the return:
If you use the return somewhere in a function, it means, that when the return is called, the function stops.
So, return means to stop a function.
You should always use it at the bottom of a function, or when you want to stop a function, like if someone needs 3000$ for a car, and he does not have 3000$, you return with a message, and the rest wont be called.
I hope you understand it.
Cheers!
pawn Код:
if(GetPlayerScore(playerid) >= 1000) SendClientMessage(playerid, COLOR_YELLOW, "Your rank is MASTER BOSS"), SetPlayerWantedLevel(playerid, 6);
else if(GetPlayerScore(playerid) >= 700) SendClientMessage(playerid, COLOR_YELLOW, "Your rank is Massive Pwner"), SetPlayerWantedLevel(playerid, 5);
else if(GetPlayerScore(playerid) >= 500) SendClientMessage(playerid, COLOR_YELLOW, "Your rank is Master"), SetPlayerWantedLevel(playerid, 4);
else if(GetPlayerScore(playerid) >= 300) SendClientMessage(playerid, COLOR_YELLOW, "Your rank is Lieunenant"), SetPlayerWantedLevel(playerid, 3);
else if(GetPlayerScore(playerid) >= 200) SendClientMessage(playerid, COLOR_YELLOW, "Your rank is Professional"), SetPlayerWantedLevel(playerid, 2);
else if(GetPlayerScore(playerid) >= 100) SendClientMessage(playerid, COLOR_YELLOW, "Your rank is Private"), SetPlayerWantedLevel(playerid, 1);
else if(GetPlayerScore(playerid) >= 50) SendClientMessage(playerid, COLOR_YELLOW, "Your rank is Newbie"), SetPlayerWantedLevel(playerid, 0);
If you use the return somewhere in a function, it means, that when the return is called, the function stops.
So, return means to stop a function.
You should always use it at the bottom of a function, or when you want to stop a function, like if someone needs 3000$ for a car, and he does not have 3000$, you return with a message, and the rest wont be called.
I hope you understand it.
Cheers!