[Tutorial] How to fix SpawnPlayer() in vehicle
#1

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
Reply
#2

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
Reply
#3

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.
Reply
#4

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.
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)