SA-MP Forums Archive
[Tutorial] How to fix SpawnPlayer() in vehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] How to fix SpawnPlayer() in vehicle (/showthread.php?tid=585465)



How to fix SpawnPlayer() in vehicle - Metharon - 14.08.2015

Add this stock:

pawn Code:
stock SpawnPlayerEX(playerid)
{
    new Float:slx, Float:sly, Float:slz;
    GetPlayerPos(playerid, slx, sly, slz);
    SetPlayerPosEx(playerid, slx, sly, slz+5);
    SpawnPlayer(playerid);
}
Now change everywhere in your gamemode from SpawnPlayer ==> SpawnPlayerEX


Re: How to fix SpawnPlayer() in vehicle - Infinity - 14.08.2015

Sorry, but this is a very poor tutorial. You don't explain what was wrong in the first place and how this fixes it. You just provide a code snippet.

Furthermore, read this tutorial: https://sampforum.blast.hk/showthread.php?tid=570635


Re: How to fix SpawnPlayer() in vehicle - SickAttack - 14.08.2015

Quote:
Originally Posted by Infinity
View Post
Sorry, but this is a very poor tutorial. You don't explain what was wrong in the first place and how this fixes it. You just provide a code snippet.

Furthermore, read this tutorial: https://sampforum.blast.hk/showthread.php?tid=570635
You are still on about that? Whether he uses stock or not, nothing is going to change. There is a difference between how to use it and why to use it.

Not to mention that any stock function that is not referred to, is completely skipped — as if it were lacking from the source file. But that's really up to who is the one programming, whether they leave un-used residue or not.

Tell me exactly, exactly, exactly why I should not use stock for function-accessibility if you are going to reply.


Re: How to fix SpawnPlayer() in vehicle - Infinity - 15.08.2015

Quote:
Originally Posted by SickAttack
View Post
You are still on about that? Whether he uses stock or not, nothing is going to change. There is a difference between how to use it and why to use it.

Not to mention that any stock function that is not referred to, is completely skipped — as if it were lacking from the source file. But that's really up to who is the one programming, whether they leave un-used residue or not.

Tell me exactly, exactly, exactly why I should not use stock for function-accessibility if you are going to reply.
For example, you could also make every variable global, or even worse, bad indentation. It won't break anything, but it is seen as bad programming. The same goes for the (ab)use of stock in these cases. The code works, but it is technically incorrect. And when writing a tutorial I expect the writer to set a good example.


Re: How to fix SpawnPlayer() in vehicle - SickAttack - 17.08.2015

Quote:
Originally Posted by Infinity
View Post
For example, you could also make every variable global, or even worse, bad indentation. It won't break anything, but it is seen as bad programming. The same goes for the (ab)use of stock in these cases. The code works, but it is technically incorrect. And when writing a tutorial I expect the writer to set a good example.
When the difference in terms of execution, use and non-use is null, exactly null, that's the last thing you should worry about when it is used for accessibility and as a benefit. As long as you know its usage, then there is no use to force yourself to do something that comes with no benefit.

And your example of the variables, has no relation to this matter. Why, you might ask. Because there are no benefits, but pure downsides.

You are also forgetting that this is SA:MP, where progress isn't really apreciated how it is with other virtual things. Progress vanishes.