SA-MP Forums Archive
Get Player Position to Stock - 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)
+--- Thread: Get Player Position to Stock (/showthread.php?tid=633826)



Get Player Position to Stock - NBass - 07.05.2017

Hello,
so, my old thread was similar. Can't get it to working / Can't understand why. So, i'm trying to get the Player Position to stock, where i'll create a Checkpoint. I searched, but didn't found information about Stock, with a good Example. If someone would say what's causing the Warning, Give a good example, or explain, how should be, to get the Value to Stock, I would be grateful.

Warning:
PHP код:
(11219) : warning 213tag mismatch
-- or --
argument type mismatch (argument 2
The Function under Public:
PHP код:
... code above
new Float:xbackFloat:ybackFloat:zback;
GetPlayerPos(playeridxbackybackzback);
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(msg,sizeof(msg),"Test: %s, %s",name,work);
MyFunction(COLOR,xbackybackzback,msg); 
PHP код:
Stock:
stock MyFunction(Float:xbackFloat:ybackFloat:zback,color,text[])
{
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
playerDB[i][work]==8)
            {
                
SendClientMessage(i,color,text);
                
SetPlayerCheckpoint(ixbackybackzback3.0);
            }    
        }
    }




Re: Get Player Position to Stock - Vince - 07.05.2017

Stop calling it "stock" for starters. The keyword stock is a function modifier that tells the compiler to remove the function from the compiled source if it isn't used. The keyword stock should usually be reserved to libraries (i.e. include files) since you will normally be using every function you create in a gamemode or filterscript.

You also need to pass your parameters to your function in the right order.


Re: Get Player Position to Stock - NBass - 07.05.2017

Thank your for correcting me.