Get Player Position to Stock
#1

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);
            }    
        }
    }

Reply
#2

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

Thank your for correcting me.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)