SA-MP Forums Archive
Custom Stock Problem :) - 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: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Custom Stock Problem :) (/showthread.php?tid=151603)



Custom Stock Problem :) - IcyBlight - 31.05.2010

I must've made some stupid error that I'm unaware of.

It says there's a arguement error(2nd arguement) in the SendMe(playerid, msg); in the EngineTimer.

pawn Код:
public EngineTimer(playerid)
{
    new rand = random(2);
  if(rand == 0)
  {
        GameTextForPlayer(playerid, "~g~Engine On", 3000, 5);
        new msg[128];
        format(msg,sizeof(msg),"turns his engine on.");
        SendMe(playerid, msg);
        SendClientMessage(playerid, COLOR_YELLOW, "Turn the engine off with /e");
        new vehicleid = GetPlayerVehicleID(playerid);
        Engine[vehicleid] = 1;
        TogglePlayerControllable(playerid, 1);
  }
  if(rand == 1)
  {
    SendClientMessage(playerid, COLOR_GREEN, "Engine failed to start.");
  }
}

stock SendMe(playerid, msg)
{
    new
    Float:meax, Float:meay, Float:meaz;
    GetPlayerPos( playerid, meax, meay, meaz );
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i, 25.0, meax, meay, meaz))
        {
            if(PlayerInfo[playerid][Masked] == 0)
        {
                new mepname[MAX_PLAYER_NAME];
                GetPlayerName(playerid, mepname, sizeof(mepname));
                new outputME[128];
                format(outputME, 128, "* %s %s", mepname, msg);
                SendClientMessage(i, COLOR_SALMON, outputME);
            }
      if(PlayerInfo[playerid][Masked] == 1)
        {
                new outputME[128];
                format(outputME, 128, "* A Stranger %s", msg);
                SendClientMessage(i, COLOR_SALMON, outputME);
            }
        }
    }
    return 1;
}



Re: Custom Stock Problem :) - Grim_ - 31.05.2010

Change
pawn Код:
stock SendMe(playerid, msg)
to
pawn Код:
stock SendMe(playerid, msg[])



Re: Custom Stock Problem :) - IcyBlight - 31.05.2010

That didn't work.

Got this.

3081 is the SendMe command,

3093 is the stock SendMe.

Код:
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\ServerScript\pawno\SLVRP.pwn(3081) : error 035: argument type mismatch (argument 2)
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\ServerScript\pawno\SLVRP.pwn(3093) : error 025: function heading differs from prototype



Re: Custom Stock Problem :) - Grim_ - 31.05.2010

Did you forward the SendMe function?


Re: Custom Stock Problem :) - IcyBlight - 31.05.2010

Hah, forgot to change the forward to msg[]

Thanks man.


Re: Custom Stock Problem :) - Grim_ - 31.05.2010

No problem